Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#generate_file(template) ⇒ Object



14
15
16
17
18
19
20
21
# File 'bin/colorize', line 14

def generate_file(template)
  file = template.gsub(@templates, @theme_name)
  dir  = File.dirname(file)
  FileUtils.mkdir_p(dir) unless File.exists?(dir)
  File.open(file, 'w') do |f|
    f.write ERB.new(IO.read(template)).result(binding)
  end
end