Sha256: 0a6c922c1bc828fbe87592e84ffed6dd0f17b51ebe7b9666afbfd1a5d11d6ae2

Contents?: true

Size: 1.11 KB

Versions: 22

Compression:

Stored size: 1.11 KB

Contents

#          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'ramaze/template/ezamar/engine'
require 'ramaze/template/ezamar/render_partial'

module Ramaze
  module Template

    # Is responsible for compiling a template using the Ezamar templating engine.

    class Ezamar < Template

      ENGINES[self] = %w[ xhtml zmr ]

      TRANSFORM_PIPELINE = [ ::Ezamar::Element ]

      class << self

        # Transforms an action into the XHTML code for parsing and returns
        # the result
        def transform action
          ezamar = wrap_compile(action)
          ezamar.result(action.binding)
        end

        # Compile a template, applying all transformations from the pipeline
        # and returning an instance of ::Ezamar::Template

        def compile(action, template)
          file = (action.template || __FILE__)

          TRANSFORM_PIPELINE.each do |tp|
            template = tp.transform(template)
          end

          ::Ezamar::Template.new(template, :file => file)
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

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