Sha256: aa61bd3563bfdc57f0300f6ef55e3e79c62f5fda8d1ac383bcee49be8ba2cc91

Contents?: true

Size: 979 Bytes

Versions: 20

Compression:

Stored size: 979 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 'haml/engine'

module Ramaze
  module Template

    # Is responsible for compiling a template using the Haml templating engine.
    # Can be found at: http://haml.hamptoncatlin.com/

    class Haml < Template

      ENGINES[self] = %w[ haml ]

      class << self

        # Transform via Haml templating engine

        def transform action
          haml = wrap_compile(action)
          haml.to_html(action.instance, action.binding.locals)
        end

        # Instantiates Haml::Engine with the template and haml_options trait from
        # the controller.

        def compile(action, template)
          opts = action.controller.trait[:haml_options] || {}
          opts.merge! :filename => action.template if action.template

          ::Haml::Engine.new(template, opts)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 5 rubygems

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