Class: Llama::FileProcessor

Inherits:
AbstractProcessor show all
Defined in:
lib/llama/processors/file_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

#process!Object



4
5
6
7
8
9
10
11
# File 'lib/llama/processors/file_processor.rb', line 4

def process!
  target_path = target.gsub('@PROJECT_NAME@', project_name)
  local_path = target_path.gsub("#{Dir.pwd}/", '')
  print "  => [creating] #{local_path}\n".green
  File.open(target_path, 'w+') do |file|
    file.write(process_content(File.read(source)))
  end
end