Sha256: 96ba5512eaba6943bf1c110e698c692c99aff127be18ddf8d4b25af97c91f25c

Contents?: true

Size: 640 Bytes

Versions: 21

Compression:

Stored size: 640 Bytes

Contents

require 'builder'

module Ramaze
  module Template

      class Builder < Template
        ENGINES[self] = %w[ builder rxml ]

        class << self
          def transform action
            if response = Response.current
              response['Content-Type'] = "application/xml"
            end

            template = wrap_compile(action)
            action.instance.instance_eval(template, action.template || __FILE__)
          end

          def compile action, template
            "xml = ::Builder::XmlMarkup.new(:indent => 2)\n" +
            template +
            "\nxml.target!\n"
          end
        end
      end

  end
end

Version data entries

21 entries across 21 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.09 lib/ramaze/template/builder.rb
Pistos-ramaze-2008.12 lib/ramaze/template/builder.rb
Pistos-ramaze-2009.01 lib/ramaze/template/builder.rb
Pistos-ramaze-2009.02 lib/ramaze/template/builder.rb
clivecrous-ramaze-0.3.9.5 lib/ramaze/template/builder.rb
manveru-ramaze-2008.07 lib/ramaze/template/builder.rb
manveru-ramaze-2008.08 lib/ramaze/template/builder.rb
manveru-ramaze-2008.09 lib/ramaze/template/builder.rb
manveru-ramaze-2008.10 lib/ramaze/template/builder.rb
manveru-ramaze-2008.12 lib/ramaze/template/builder.rb
manveru-ramaze-2009.01 lib/ramaze/template/builder.rb
ptomato-ramaze-2009.02.1 lib/ramaze/template/builder.rb
ptomato-ramaze-2009.02 lib/ramaze/template/builder.rb
ramaze-0.3.5 lib/ramaze/template/builder.rb
ramaze-2009.01 lib/ramaze/template/builder.rb
ramaze-0.3.9.1 lib/ramaze/template/builder.rb
ramaze-0.3.9 lib/ramaze/template/builder.rb
ramaze-2008.11 lib/ramaze/template/builder.rb
ramaze-2008.06 lib/ramaze/template/builder.rb
ramaze-2009.03 lib/ramaze/template/builder.rb