Class: Ramaze::Template::Sass

Inherits:
Template show all
Defined in:
lib/ramaze/template/sass.rb

Overview

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

Class Method Summary collapse

Methods inherited from Template

caching_compile, reaction_or_file, render_method, result_and_file, wrap_compile

Methods included from Helper::Methods

extend_object, #helper, included

Class Method Details

.compile(action, template) ⇒ Object

Instantiates Sass::Engine with the template and sass_options trait from the controller.



31
32
33
# File 'lib/ramaze/template/sass.rb', line 31

def compile(action, template)
  ::Sass::Engine.new(template, action.controller.trait[:sass_options] || {})
end

.transform(action) ⇒ Object

Transform via Sass templating engine



20
21
22
23
24
25
26
# File 'lib/ramaze/template/sass.rb', line 20

def transform action
  if response = Response.current
    response['Content-Type'] = "text/css"
  end
  sass = wrap_compile(action)
  sass.to_css()
end