Class Tilt::BuilderTemplate
In: lib/tilt/builder.rb
Parent: Template

Builder template implementation. See: builder.rubyforge.org/

Methods

Public Class methods

[Source]

    # File lib/tilt/builder.rb, line 9
 9:     def self.engine_initialized?
10:       defined? ::Builder
11:     end

Public Instance methods

[Source]

    # File lib/tilt/builder.rb, line 19
19:     def evaluate(scope, locals, &block)
20:       return super(scope, locals, &block) if data.respond_to?(:to_str)
21:       xml = ::Builder::XmlMarkup.new(:indent => 2)
22:       data.call(xml)
23:       xml.target!
24:     end

[Source]

    # File lib/tilt/builder.rb, line 13
13:     def initialize_engine
14:       require_template_library 'builder'
15:     end

[Source]

    # File lib/tilt/builder.rb, line 31
31:     def precompiled_postamble(locals)
32:       "xml.target!"
33:     end

[Source]

    # File lib/tilt/builder.rb, line 26
26:     def precompiled_preamble(locals)
27:       return super if locals.include? :xml
28:       "xml = ::Builder::XmlMarkup.new(:indent => 2)\n#{super}"
29:     end

[Source]

    # File lib/tilt/builder.rb, line 35
35:     def precompiled_template(locals)
36:       data.to_str
37:     end

[Source]

    # File lib/tilt/builder.rb, line 17
17:     def prepare; end

[Validate]