Method: Meetupinator::Formatter#format
- Defined in:
- lib/meetupinator/formatter.rb
#format(events, template_file, output_file) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/meetupinator/formatter.rb', line 6 def format(events, template_file, output_file) template_engine = ERB.new(File.read(template_file)) parameters = TemplateContext.new(events) output = template_engine.result(parameters.template_binding) FileUtils.mkdir_p(File.dirname(output_file)) File.write(output_file, output) end |