Class: ForemanDebian::Template::Storage

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/foreman_debian/template.rb

Direct Known Subclasses

Initd::Script

Instance Method Summary collapse

Instance Method Details

#render(template_name) ⇒ Object



5
6
7
8
9
# File 'lib/foreman_debian/template.rb', line 5

def render(template_name)
  templates_dir = Pathname.new(__FILE__).dirname.dirname.dirname.join('templates')
  template = templates_dir.join("#{template_name}.erb")
  ERB.new(template.read).result(binding)
end