Class: Thor::Actions::Directory
- Inherits:
-
EmptyDirectory
- Object
- EmptyDirectory
- Thor::Actions::Directory
- Defined in:
- lib/thor/actions/directory.rb
Overview
:nodoc:
Instance Attribute Summary (collapse)
-
- (Object) source
readonly
Returns the value of attribute source.
Attributes inherited from EmptyDirectory
#base, #config, #destination, #given_destination, #relative_destination
Instance Method Summary (collapse)
-
- (Directory) initialize(base, source, destination = nil, config = {}, &block)
constructor
A new instance of Directory.
- - (Object) invoke!
- - (Object) revoke!
Methods inherited from EmptyDirectory
Constructor Details
- (Directory) initialize(base, source, destination = nil, config = {}, &block)
A new instance of Directory
57 58 59 60 61 |
# File 'lib/thor/actions/directory.rb', line 57 def initialize(base, source, destination=nil, config={}, &block) @source = File.(base.find_in_source_paths(source.to_s)) @block = block super(base, destination, { :recursive => true }.merge(config)) end |
Instance Attribute Details
- (Object) source (readonly)
Returns the value of attribute source
55 56 57 |
# File 'lib/thor/actions/directory.rb', line 55 def source @source end |
Instance Method Details
- (Object) invoke!
63 64 65 66 |
# File 'lib/thor/actions/directory.rb', line 63 def invoke! base.empty_directory given_destination, config execute! end |
- (Object) revoke!
68 69 70 |
# File 'lib/thor/actions/directory.rb', line 68 def revoke! execute! end |