Malt  Malt::Engine::Erubis

[Validate]
Generated with RDazzle Newfish 1.4.0

Erubis

Erubis template implementation.

  http://www.kuwata-lab.com/erubis/

Erubis is essentially compatibel with ERB, but it is faster.

Public Instance Methods

compile(params) click to toggle source

Compile template into Ruby source code.

    # File lib/malt/engines/erubis.rb, line 24
24:     def compile(params)
25:       text = params[:text]
26:       file = params[:file]
27:       intermediate(text, file).src
28:     end
intermediate(params) click to toggle source
    # File lib/malt/engines/erubis.rb, line 31
31:     def intermediate(params)
32:       text = params[:text]
33:       file = params[:file]
34: 
35:       opts = {}
36: 
37:       if params[:escape_html] || settings[:escape_html]
38:         ::Erubis::EscapedEruby.new(text, settings)
39:       else
40:         ::Erubis::Eruby.new(text, settings)
41:       end
42:     end
render(params, &yld) click to toggle source

Render template.

    # File lib/malt/engines/erubis.rb, line 16
16:     def render(params, &yld)
17:       text = params[:text]
18:       data = params[:data]
19:       data = make_binding(data, &yld)
20:       intermediate(params).result(data)
21:     end
safe() click to toggle source
    # File lib/malt/engines/erubis.rb, line 45
45:     def safe
46:       options[:safe]
47:     end
trim() click to toggle source
    # File lib/malt/engines/erubis.rb, line 50
50:     def trim
51:       options[:trim]
52:     end

Private Instance Methods

initialize_engine() click to toggle source

Load ERB library if not already loaded.

    # File lib/malt/engines/erubis.rb, line 57
57:     def initialize_engine
58:       return if defined? ::Erubius
59:       require_library('erubis')
60:     end

Disabled; run with --debug to generate this.