In Files

Tilt::HamlTemplate

Haml template implementation. See: haml.hamptoncatlin.com/

Public Class Methods

engine_initialized?() click to toggle source
    # File lib/tilt/haml.rb, line 9
 9:     def self.engine_initialized?
10:       defined? ::Haml::Engine
11:     end

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
    # File lib/tilt/haml.rb, line 22
22:     def evaluate(scope, locals, &block)
23:       if @engine.respond_to?(:precompiled_method_return_value, true)
24:         super
25:       else
26:         @engine.render(scope, locals, &block)
27:       end
28:     end
initialize_engine() click to toggle source
    # File lib/tilt/haml.rb, line 13
13:     def initialize_engine
14:       require_template_library 'haml'
15:     end
precompiled_postamble(locals) click to toggle source
    # File lib/tilt/haml.rb, line 52
52:     def precompiled_postamble(locals)
53:       @engine.instance_eval do
54:                     #{precompiled_method_return_value}          ensure            @haml_buffer = @haml_buffer.upper          end
55:       end
56:     end
precompiled_preamble(locals) click to toggle source
    # File lib/tilt/haml.rb, line 37
37:     def precompiled_preamble(locals)
38:       local_assigns = super
39:       @engine.instance_eval do
40:                   begin            extend Haml::Helpers            _hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, #{options_for_buffer.inspect})            _erbout = _hamlout.buffer            __in_erb_template = true            _haml_locals = locals            #{local_assigns}
41:       end
42:     end
precompiled_template(locals) click to toggle source

Precompiled Haml source. Taken from the precompiled_with_ambles method in Haml::Precompiler: github.com/nex3/haml/blob/master/lib/haml/precompiler.rb#L111-126

    # File lib/tilt/haml.rb, line 33
33:     def precompiled_template(locals)
34:       @engine.precompiled
35:     end
prepare() click to toggle source
    # File lib/tilt/haml.rb, line 17
17:     def prepare
18:       options = @options.merge(:filename => eval_file, :line => line)
19:       @engine = ::Haml::Engine.new(data, options)
20:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.