Sha256: c0801f10d81d21b673746a90e59f185ae3ba4851983e27626f0d64641e97942b
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
require File.join(File.dirname(__FILE__), '..', "view_template") require File.join(File.dirname(__FILE__), 'base') module Mack module Rendering # :nodoc: module Engine # :nodoc: # Allows use of the Builder::XmlMarkup engine to be used with rendering. class Builder < Mack::Rendering::Engine::Base def render(io, binding) if io.is_a?(File) io = io.read end @_xml = ::Builder::XmlMarkup.new(:target => @_xml_output, :indent => 1) view_template.instance_variable_set("@_xml", @_xml) eval(io, binding) end def extension :builder end # Used to give XmlBuilder templates access to a 'root' xml object. module ViewTemplateHelpers def xml @_xml end end # ViewTemplateHelpers end # Builder end # Engine end # Rendering end # Mack Mack::Rendering::ViewTemplate.send(:include, Mack::Rendering::Engine::Builder::ViewTemplateHelpers)
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mack-0.8.3 | lib/mack/rendering/engine/builder.rb |
mack-0.8.3.1 | lib/mack/rendering/engine/builder.rb |