class Tilt::SassTemplate

Sass template implementation. See: haml.hamptoncatlin.com/

Sass templates do not support object scopes, locals, or yield.

Constants

Engine

Public Instance Methods

allows_script?() click to toggle source
   # File lib/tilt/sass.rb
43 def allows_script?
44   false
45 end
evaluate(scope, locals, &block) click to toggle source
   # File lib/tilt/sass.rb
35 def evaluate(scope, locals, &block)
36   @output ||= if @engine.nil?
37                 ::Sass.compile_string(data, **sass_embedded_options).css
38               else
39                 @engine.render
40               end
41 end
prepare() click to toggle source
   # File lib/tilt/sass.rb
29 def prepare
30   @engine = unless Engine.nil?
31               Engine.new(data, sass_options)
32             end
33 end

Private Instance Methods

eval_file_url() click to toggle source
   # File lib/tilt/sass.rb
48 def eval_file_url
49   path = File.absolute_path(eval_file)
50   path = '/' + path unless path.start_with?('/')
51   ::URI::File.build([nil, ::URI::DEFAULT_PARSER.escape(path)]).to_s
52 end
sass_embedded_options() click to toggle source
   # File lib/tilt/sass.rb
54 def sass_embedded_options
55   options.merge(:url => eval_file_url, :syntax => :indented)
56 end
sass_options() click to toggle source
   # File lib/tilt/sass.rb
58 def sass_options
59   options.merge(:filename => eval_file, :line => line, :syntax => :sass)
60 end