module Formatron::Generators::Instance::Formatronfile
generates a bootstrap Formatronfile
Public Class Methods
write(directory, params)
click to toggle source
# File lib/formatron/generators/instance/formatronfile.rb, line 23 def self.write(directory, params) FileUtils.mkdir_p directory formatronfile = File.join directory, 'Formatronfile' File.write formatronfile, _content(params) end
Private Class Methods
_content(params)
click to toggle source
# File lib/formatron/generators/instance/formatronfile.rb, line 29 def self._content(params) template = File.join( File.dirname(File.expand_path(__FILE__)), File.basename(__FILE__, '.rb'), 'Formatronfile.erb' ) erb = ERB.new File.read(template) erb.filename = template erb_template = erb.def_class Template, 'render()' erb_template.new(params).render end