Class: Foreman::Renderer::UnsafeModeRenderer

Inherits:
BaseRenderer show all
Defined in:
lib/foreman/renderer/unsafe_mode_renderer.rb

Instance Method Summary collapse

Methods inherited from BaseRenderer

#initialize, render

Constructor Details

This class inherits a constructor from Foreman::Renderer::BaseRenderer

Instance Method Details

#renderObject


4
5
6
7
8
9
10
11
12
# File 'lib/foreman/renderer/unsafe_mode_renderer.rb', line 4

def render
  erb = ERB.new(source_content, nil, '-')
  erb.location = source_name, 0
  erb.result(get_binding)
rescue ::SyntaxError => e
  new_e = SyntaxError.new(name: source_name, message: e.message)
  new_e.set_backtrace(e.backtrace)
  raise new_e
end