2007-12-09 17:11:11 -05:00
|
|
|
module ActionView
|
2009-12-02 23:01:01 -05:00
|
|
|
module Template::Handlers
|
|
|
|
class Builder < Template::Handler
|
2008-01-21 20:46:34 -05:00
|
|
|
include Compilable
|
|
|
|
|
2009-05-21 17:22:07 -04:00
|
|
|
self.default_format = Mime::XML
|
|
|
|
|
2007-12-09 17:11:11 -05:00
|
|
|
def compile(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
|