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

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

Methods

Public Instance methods

[Source]

     # File lib/tilt.rb, line 669
669:     def evaluate(scope, locals, &block)
670:       return super(scope, locals, &block) if data.respond_to?(:to_str)
671:       xml = ::Builder::XmlMarkup.new(:indent => 2)
672:       data.call(xml)
673:       xml.target!
674:     end

[Source]

     # File lib/tilt.rb, line 662
662:     def initialize_engine
663:       return if defined?(::Builder)
664:       require_template_library 'builder'
665:     end

[Source]

     # File lib/tilt.rb, line 681
681:     def precompiled_postamble(locals)
682:       "xml.target!"
683:     end

[Source]

     # File lib/tilt.rb, line 676
676:     def precompiled_preamble(locals)
677:       return super if locals.include? :xml
678:       "xml = ::Builder::XmlMarkup.new(:indent => 2)\n#{super}"
679:     end

[Source]

     # File lib/tilt.rb, line 685
685:     def precompiled_template(locals)
686:       data.to_str
687:     end

[Source]

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

[Validate]