class Tilt::NokogiriTemplate
nokogiri.org/
Nokogiri template implementation. See:
def self.engine_initialized?
def self.engine_initialized? defined? ::Nokogiri end
def evaluate(scope, locals, &block)
def evaluate(scope, locals, &block) block &&= proc { yield.gsub(/^<\?xml version=\"1\.0\"\?>\n?/, "") } if data.respond_to?(:to_str) super(scope, locals, &block) else ::Nokogiri::XML::Builder.new.tap(&data).to_xml end end
def initialize_engine
def initialize_engine require_template_library 'nokogiri' end
def precompiled_postamble(locals)
def precompiled_postamble(locals) "xml.to_xml" end
def precompiled_preamble(locals)
def precompiled_preamble(locals) return super if locals.include? :xml "xml = ::Nokogiri::XML::Builder.new { |xml| }\n#{super}" end
def precompiled_template(locals)
def precompiled_template(locals) data.to_str end
def prepare; end
def prepare; end