/usr/lib/ruby/vendor_ruby/tilt/builder.rb is in ruby-tilt 2.0.0+really1.4.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | require 'tilt/template'
module Tilt
# Builder template implementation. See:
# http://builder.rubyforge.org/
class BuilderTemplate < Template
self.default_mime_type = 'text/xml'
def self.engine_initialized?
defined? ::Builder
end
def initialize_engine
require_template_library 'builder'
end
def prepare; end
def evaluate(scope, locals, &block)
return super(scope, locals, &block) if data.respond_to?(:to_str)
xml = ::Builder::XmlMarkup.new(:indent => 2)
data.call(xml)
xml.target!
end
def precompiled_preamble(locals)
return super if locals.include? :xml
"xml = ::Builder::XmlMarkup.new(:indent => 2)\n#{super}"
end
def precompiled_postamble(locals)
"xml.target!"
end
def precompiled_template(locals)
data.to_str
end
end
end
|