class Tilt::ERBTemplate
ERB template implementation. See: www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html
Public Class Methods
default_output_variable()
click to toggle source
# File lib/tilt/erb.rb, line 10 def self.default_output_variable @@default_output_variable end
default_output_variable=(name)
click to toggle source
# File lib/tilt/erb.rb, line 14 def self.default_output_variable=(name) warn "#{self}.default_output_variable= has been replaced with the :outvar-option" @@default_output_variable = name end
Public Instance Methods
precompiled(locals)
click to toggle source
Calls superclass method
Template#precompiled
# File lib/tilt/erb.rb, line 50 def precompiled(locals) source, offset = super [source, offset + 1] end
precompiled_postamble(locals)
click to toggle source
# File lib/tilt/erb.rb, line 38 def precompiled_postamble(locals) <<-RUBY #{super} ensure #{@outvar} = __original_outvar end RUBY end
precompiled_preamble(locals)
click to toggle source
# File lib/tilt/erb.rb, line 30 def precompiled_preamble(locals) <<-RUBY begin __original_outvar = #{@outvar} if defined?(#{@outvar}) #{super} RUBY end
precompiled_template(locals)
click to toggle source
# File lib/tilt/erb.rb, line 25 def precompiled_template(locals) source = @engine.src source end
prepare()
click to toggle source
# File lib/tilt/erb.rb, line 19 def prepare @outvar = options[:outvar] || self.class.default_output_variable options[:trim] = '<>' if !(options[:trim] == false) && (options[:trim].nil? || options[:trim] == true) @engine = ::ERB.new(data, options[:safe], options[:trim], @outvar) end