Module: RedmineCLI::TemplateRenderer
- Defined in:
- lib/redmine_cli/template_renderer.rb
Overview
Renders templates
Defined Under Namespace
Classes: ErbEnvironment
Class Method Summary collapse
-
.render(template, variables = {}) ⇒ Object
finds template and renders it.
Class Method Details
.render(template, variables = {}) ⇒ Object
finds template and renders it
18 19 20 21 22 23 |
# File 'lib/redmine_cli/template_renderer.rb', line 18 def self.render(template, variables = {}) path = File.(template.to_s, @template_directory) + '.erb' fail "Template not found: #{path}" unless File.exist? path ErbEnvironment.new(File.read(path), variables).render end |