Class: Avm::Files::Appendable::PlainDirectory
- Inherits:
-
ResourceBase
- Object
- ResourceBase
- Avm::Files::Appendable::PlainDirectory
- Defined in:
- lib/avm/files/appendable/plain_directory.rb
Instance Attribute Summary collapse
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
Instance Method Summary collapse
-
#initialize(appender, source_path) ⇒ PlainDirectory
constructor
A new instance of PlainDirectory.
- #to_s_attributes ⇒ Enumerable<Symbol>
- #write_on(target_dir) ⇒ Object
Methods inherited from ResourceBase
Constructor Details
#initialize(appender, source_path) ⇒ PlainDirectory
Returns a new instance of PlainDirectory.
12 13 14 15 |
# File 'lib/avm/files/appendable/plain_directory.rb', line 12 def initialize(appender, source_path) super(appender) @source_path = source_path.to_pathname end |
Instance Attribute Details
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
10 11 12 |
# File 'lib/avm/files/appendable/plain_directory.rb', line 10 def source_path @source_path end |
Instance Method Details
#to_s_attributes ⇒ Enumerable<Symbol>
24 25 26 |
# File 'lib/avm/files/appendable/plain_directory.rb', line 24 def to_s_attributes [:source_path] end |
#write_on(target_dir) ⇒ Object
[View source]
17 18 19 20 21 |
# File 'lib/avm/files/appendable/plain_directory.rb', line 17 def write_on(target_dir) raise "\"#{source_path}\" is not a directory" unless source_path.directory? ::FileUtils.cp_r("#{source_path}/.", target_dir.to_path) end |