Class: Zfben_libjs::Scss

Inherits:
Source
  • Object
show all
Defined in:
lib/zfben_libjs/support_source/scss.rb

Instance Attribute Summary

Attributes inherited from Source

#compiled, #filepath, #minified, #options, #source

Instance Method Summary collapse

Methods inherited from Source

#compile, #download!, #initialize, #minify, #name, #remote?, #type

Constructor Details

This class inherits a constructor from Zfben_libjs::Source

Instance Method Details

#after_initializeObject



2
3
4
5
6
# File 'lib/zfben_libjs/support_source/scss.rb', line 2

def after_initialize
  @options = @options.merges({ :syntax => :scss }, Compass.sass_engine_options)
  @options[:load_paths].push File.dirname(@filepath)
  @source = "@import \"compass\";\n" + @source
end

#before_compileObject



12
13
14
# File 'lib/zfben_libjs/support_source/scss.rb', line 12

def before_compile
  @compiled = Sass::Engine.new(@source, @options).render
end

#before_minifyObject



16
17
18
# File 'lib/zfben_libjs/support_source/scss.rb', line 16

def before_minify
  @minified = Zfben_libjs::Css.new(:source => @compiled, :options => @options).minify
end

#to_cssObject



8
9
10
# File 'lib/zfben_libjs/support_source/scss.rb', line 8

def to_css
  compile
end