class Tilt::ERBTemplate
www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html<br>ERB template implementation. See:
def compile!
def compile! @engine = ::ERB.new(data, options[:safe], options[:trim], '@_out_buf') end
def evaluate(scope, locals, &block)
def evaluate(scope, locals, &block) source, offset = local_assignment_code(locals) source = [source, template_source].join("\n") original_out_buf = scope.instance_variables.any? { |var| var.to_sym == :@_out_buf } && scope.instance_variable_get(:@_out_buf) scope.instance_eval source, eval_file, line - offset output = scope.instance_variable_get(:@_out_buf) scope.instance_variable_set(:@_out_buf, original_out_buf) output end
def initialize_engine
def initialize_engine require_template_library 'erb' unless defined? ::ERB end
def local_assignment_code(locals)
def local_assignment_code(locals) source, offset = super [source, offset + 1] end
def template_source
def template_source @engine.src end