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

Nokogiri template implementation. See: nokogiri.org/

Methods

Public Instance methods

[Source]

     # File lib/tilt.rb, line 630
630:     def evaluate(scope, locals, &block)
631:       xml = ::Nokogiri::XML::Builder.new
632:       if data.respond_to?(:to_str)
633:         locals[:xml] = xml
634:         block &&= proc { yield.gsub(/^<\?xml version=\"1\.0\"\?>\n?/, "") }
635:         super(scope, locals, &block)
636:       elsif data.kind_of?(Proc)
637:         data.call(xml)
638:       end
639:       xml.to_xml
640:     end

[Source]

     # File lib/tilt.rb, line 623
623:     def initialize_engine
624:       return if defined?(::Nokogiri)
625:       require_template_library 'nokogiri'
626:     end

[Source]

     # File lib/tilt.rb, line 642
642:     def precompiled_template(locals)
643:       data.to_str
644:     end

[Source]

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

[Validate]