class Tilt::ErubisTemplate

Erubis template implementation. See: www.kuwata-lab.com/erubis/

ErubisTemplate supports the following additional options, which are not passed down to the Erubis engine:

:engine_class   allows you to specify a custom engine class to use
                instead of the default (which is ::Erubis::Eruby).

:escape_html    when true, ::Erubis::EscapedEruby will be used as
                the engine class instead of the default. All content
                within <%= %> blocks will be automatically html escaped.

Public Instance Methods

precompiled(locals) click to toggle source
Calls superclass method Tilt::ERBTemplate#precompiled
   # File lib/tilt/erubis.rb
37 def precompiled(locals)
38   source, offset = super
39   [source, offset - 1]
40 end
precompiled_postamble(locals) click to toggle source
Calls superclass method Tilt::ERBTemplate#precompiled_postamble
   # File lib/tilt/erubis.rb
30 def precompiled_postamble(locals)
31   [@outvar, super].join("\n")
32 end
precompiled_preamble(locals) click to toggle source
Calls superclass method Tilt::ERBTemplate#precompiled_preamble
   # File lib/tilt/erubis.rb
26 def precompiled_preamble(locals)
27   [super, "#{@outvar} = _buf = String.new"].join("\n")
28 end
prepare() click to toggle source
   # File lib/tilt/erubis.rb
18 def prepare
19   @outvar = options.delete(:outvar) || self.class.default_output_variable
20   @options.merge!(:preamble => false, :postamble => false, :bufvar => @outvar)
21   engine_class = options.delete(:engine_class)
22   engine_class = ::Erubis::EscapedEruby if options.delete(:escape_html)
23   @engine = (engine_class || ::Erubis::Eruby).new(data, options)
24 end