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