Sha256: b68ad8a5253852011891e24faa2b35503097cb5bd32d0573dd442eb88f01326b
Contents?: true
Size: 1.19 KB
Versions: 3
Compression:
Stored size: 1.19 KB
Contents
# Copyright (c) 2006 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 # Custom HAML-options for your controller to be merged. trait :haml_options => { :locals => {} } ENGINES[self] = %w[ haml ] class << self # Transform any String via Haml, takes optionally an hash with the # haml_options that you can set also by # trait :haml_options => {} # if you pass the options it will merge the trait with them. (your # options override the defaults from trait[:haml_options] def transform action haml = wrap_compile(action) haml.to_html(action.instance) end # Instantiates Haml::Engine with the template and haml_options from # the trait. def compile(action, template) ::Haml::Engine.new(template, ancestral_trait[:haml_options]) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ramaze-0.1.3 | lib/ramaze/template/haml.rb |
ramaze-0.1.4 | lib/ramaze/template/haml.rb |
ramaze-0.2.0 | lib/ramaze/template/haml.rb |