2007-12-09 17:11:11 -05:00
|
|
|
module ActionView
|
2009-12-02 23:01:01 -05:00
|
|
|
module Template::Handlers
|
2010-10-09 19:14:50 -04:00
|
|
|
class Builder
|
|
|
|
# Default format used by Builder.
|
|
|
|
class_attribute :default_format
|
2009-05-21 17:22:07 -04:00
|
|
|
self.default_format = Mime::XML
|
|
|
|
|
2010-10-09 19:14:50 -04:00
|
|
|
def call(template)
|
2009-09-24 21:36:40 -04:00
|
|
|
require 'builder'
|
2009-06-17 19:23:11 -04:00
|
|
|
"xml = ::Builder::XmlMarkup.new(:indent => 2);" +
|
2008-07-15 15:41:38 -04:00
|
|
|
"self.output_buffer = xml.target!;" +
|
2008-06-02 16:32:58 -04:00
|
|
|
template.source +
|
2008-07-05 18:31:57 -04:00
|
|
|
";xml.target!;"
|
2007-12-09 17:11:11 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|