Class: Rcli::Actions::Directory

Inherits:
EmptyDirectory show all
Defined in:
lib/core/thor_actions/directory.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from EmptyDirectory

#base, #config, #destination, #given_destination, #relative_destination

Instance Method Summary collapse

Methods inherited from EmptyDirectory

#create, #exists?

Constructor Details

#initialize(base, source, destination = nil, config = {}, &block) ⇒ Directory

Returns a new instance of Directory.



48
49
50
51
52
# File 'lib/core/thor_actions/directory.rb', line 48

def initialize(base, source, destination=nil, config={}, &block)
  @source = File.expand_path(base.find_in_source_paths(source.to_s))
  @block  = block
  super(base, destination, { :recursive => true }.merge(config))
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



46
47
48
# File 'lib/core/thor_actions/directory.rb', line 46

def source
  @source
end

Instance Method Details

#invoke!Object



54
55
56
57
# File 'lib/core/thor_actions/directory.rb', line 54

def invoke!
  base.empty_directory given_destination, config
  execute!
end

#revoke!Object



59
60
61
# File 'lib/core/thor_actions/directory.rb', line 59

def revoke!
  execute!
end