Class: Tilt::ErubisTemplate

Inherits:
ERBTemplate show all
Defined in:
lib/sinatra/tilt.rb

Overview

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

Instance Attribute Summary

Attributes inherited from Template

#data, #file, #line, #options

Instance Method Summary collapse

Methods inherited from ERBTemplate

#evaluate, #template_source

Methods inherited from Template

#basename, #compile, #eval_file, #initialize, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#compile!Object



261
262
263
264
# File 'lib/sinatra/tilt.rb', line 261

def compile!
  Erubis::Eruby.class_eval(%Q{def add_preamble(src) src << "@_out_buf = _buf = '';" end})
  @engine = ::Erubis::Eruby.new(data, options)
end

#initialize_engineObject



257
258
259
# File 'lib/sinatra/tilt.rb', line 257

def initialize_engine
  require_template_library 'erubis' unless defined? ::Erubis
end