class Padrino::Rendering::ErubisTemplate
@api private
buffer.
Modded ErubisTemplate that doesn’t insist in an String as output
#
def precompiled_preamble(locals)
In preamble we need a flag `__in_erb_template` and SafeBuffer for padrino apps.
#
def precompiled_preamble(locals) original = super return original unless @is_padrino_app "__in_erb_template = true\n" << original.rpartition("\n").first << "#{@outvar} = _buf = SafeBuffer.new\n" end
def render(*args)
def render(*args) app = args.first app_class = app.class @is_padrino_app = (defined?(Padrino::Application) && app.kind_of?(Padrino::Application)) || (app_class.respond_to?(:erb) && app_class.erb[:engine_class] == Padrino::Rendering::SafeEruby) super end