Class: Llama::DirProcessor

Inherits:
AbstractProcessor show all
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

#initialize

Constructor Details

This class inherits a constructor from Llama::AbstractProcessor

Instance Method Details

#contentObject



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