Class: Sprockets::SassCompressor

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/sprockets/sass_compressor.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.engine_initialized?Boolean


7
8
9
# File 'lib/sprockets/sass_compressor.rb', line 7

def self.engine_initialized?
  defined?(::Sass::Engine)
end

Instance Method Details

#evaluate(context, locals, &block) ⇒ Object


18
19
20
21
22
23
24
25
# File 'lib/sprockets/sass_compressor.rb', line 18

def evaluate(context, locals, &block)
  ::Sass::Engine.new(data, {
    :syntax => :scss,
    :cache => false,
    :read_cache => false,
    :style => :compressed
  }).render
end

#initialize_engineObject


11
12
13
# File 'lib/sprockets/sass_compressor.rb', line 11

def initialize_engine
  require_template_library 'sass'
end

#prepareObject


15
16
# File 'lib/sprockets/sass_compressor.rb', line 15

def prepare
end