class Tennpipes::Rendering::ErubisTemplate
Modded ErubisTemplate
that doesn't insist in an String as output buffer.
@api private
Public Instance Methods
precompiled_preamble(locals)
click to toggle source
In preamble we need a flag `__in_erb_template` and SafeBuffer for tennpipes apps.
Calls superclass method
# File lib/tennpipes/rendering/erubis_template.rb, line 53 def precompiled_preamble(locals) original = super return original unless @is_tennpipes_app "__in_erb_template = true\n" << original.rpartition("\n").first << "#{@outvar} = _buf = ActiveSupport::SafeBuffer.new\n" end
render(*args)
click to toggle source
Calls superclass method
# File lib/tennpipes/rendering/erubis_template.rb, line 42 def render(*args) app = args.first app_class = app.class @is_tennpipes_app = (defined?(Tennpipes::Application) && app.kind_of?(Tennpipes::Application)) || (app_class.respond_to?(:erb) && app_class.erb[:engine_class] == Tennpipes::Rendering::SafeEruby) super end