Sha256: 3c86aca42abb33bc14e33befcb6a5f1d4ba0cbee2e4f21cbe3ee290013c0fc1f

Contents?: true

Size: 929 Bytes

Versions: 4

Compression:

Stored size: 929 Bytes

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 'erubis'

module Ramaze
  module Template

    # Is responsible for compiling a template using the Erubis templating engine.
    # Can be found at: http://rubyforge.org/projects/erubis

    class Erubis < Template

      ENGINES[self] = %w[ rhtml ]

      class << self

        # Entry-point for Action#render

        def transform action
          eruby = wrap_compile(action)
          eruby.result(action.binding)
        end

        # Creates an instance of ::Erubis::Eruby, sets the filename
        # from the template and returns the instance.
        def compile(action, template)
          eruby = ::Erubis::Eruby.new(template)
          eruby.init_evaluator(:filename => (action.template || __FILE__))
          eruby
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ramaze-0.3.0 lib/ramaze/template/erubis.rb
ramaze-0.3.5 lib/ramaze/template/erubis.rb
ramaze-0.3.9 lib/ramaze/template/erubis.rb
ramaze-0.3.9.1 lib/ramaze/template/erubis.rb