Sha256: f79c2460fdd36b82972bcfd91a1c7e48050c26104543035bf03acf0ebae5b3cc
Contents?: true
Size: 728 Bytes
Versions: 21
Compression:
Stored size: 728 Bytes
Contents
require 'tilt/template' require 'builder' module Tilt # Builder template implementation. See: # http://builder.rubyforge.org/ class BuilderTemplate < Template self.default_mime_type = 'text/xml' def prepare options[:indent] ||= 2 end def evaluate(scope, locals, &block) xml = (locals[:xml] || ::Builder::XmlMarkup.new(options)) if data.respond_to?(:to_str) if !locals[:xml] locals = locals.merge(:xml => xml) end return super(scope, locals, &block) end data.call(xml) xml.target! end def precompiled_postamble(locals) "xml.target!" end def precompiled_template(locals) data.to_str end end end
Version data entries
21 entries across 21 versions & 6 rubygems