Sha256: 377bf7bb527434c55fbf356edaca874597d0057b2fe66996e6d0cf03f776e30d
Contents?: true
Size: 1.01 KB
Versions: 113
Compression:
Stored size: 1.01 KB
Contents
require 'tilt/template' module Tilt # Sass template implementation. See: # http://haml.hamptoncatlin.com/ # # Sass templates do not support object scopes, locals, or yield. class SassTemplate < Template self.default_mime_type = 'text/css' begin require 'sassc' Sass = ::SassC rescue LoadError => err begin require 'sass' Sass = ::Sass rescue LoadError raise err end end def prepare @engine = Sass::Engine.new(data, sass_options) end def evaluate(scope, locals, &block) @output ||= @engine.render end def allows_script? false end private def sass_options options.merge(:filename => eval_file, :line => line, :syntax => :sass) end end # Sass's new .scss type template implementation. class ScssTemplate < SassTemplate self.default_mime_type = 'text/css' private def sass_options options.merge(:filename => eval_file, :line => line, :syntax => :scss) end end end
Version data entries
113 entries across 79 versions & 11 rubygems