Sha256: ee31ed22eedf6bac9ba3915e442a5f5667685f97977695b38e1c75e30eceeb1c

Contents?: true

Size: 724 Bytes

Versions: 6

Compression:

Stored size: 724 Bytes

Contents

require 'ezamar'

module Ramaze
  module View
    ##
    # View adapter for the Ezamar template engine. More information about this
    # engine can be found here: https://github.com/manveru/ezamar
    #
    module Ezamar
      TRANSFORM_PIPELINE = [ ::Ezamar::Element ]

      def self.call(action, string)
        ezamar = View.compile(string){|s| compile(action, s) }
        html = ezamar.result(action.binding)
        return html, 'text/html'
      end

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

        TRANSFORM_PIPELINE.each{|tp| template = tp.transform(template) }

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ramaze-2023.01.06 lib/ramaze/view/ezamar.rb
ramaze-2012.12.08 lib/ramaze/view/ezamar.rb
ramaze-2012.12.08b lib/ramaze/view/ezamar.rb
ramaze-2011.12.28 lib/ramaze/view/ezamar.rb
ramaze-2011.10.23 lib/ramaze/view/ezamar.rb
ramaze-2011.07.25 lib/ramaze/view/ezamar.rb