Class: Llama::DirProcessor
- Inherits:
-
AbstractProcessor
- Object
- AbstractProcessor
- Llama::DirProcessor
- Defined in:
- lib/llama/processors/dir_processor.rb
Instance Attribute Summary
Attributes inherited from AbstractProcessor
#project_name, #source, #target
Instance Method Summary collapse
Methods inherited from AbstractProcessor
Constructor Details
This class inherits a constructor from Llama::AbstractProcessor
Instance Method Details
#content ⇒ Object
15 16 17 |
# File 'lib/llama/processors/dir_processor.rb', line 15 def content Dir.entries(source) - ['.', '..', '.git'] end |
#process! ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/llama/processors/dir_processor.rb', line 2 def process! content.sort.each do |name| entry_path = File.join(source, name) target_path = File.join(target, name) if File.directory?(entry_path) Dir.mkdir(target_path) Llama::DirProcessor.new(entry_path, target_path, project_name).process! else Llama::FileProcessor.new(entry_path, target_path, project_name).process! end end end |