Class: MoCo::SassCompiler

Inherits:
CssCompiler show all
Defined in:
lib/moco/compilers/sass_compiler.rb

Instance Attribute Summary

Attributes inherited from Compiler

#compiled_file, #source_file

Instance Method Summary collapse

Methods inherited from CssCompiler

compiled_extension, #error_text

Methods inherited from Compiler

#compile, compiled_extension, convert_option, #initialize, options, register, require_library, set_option, #should_compile?, #source_text

Constructor Details

This class inherits a constructor from MoCo::Compiler

Instance Method Details

#compiled_textObject



9
10
11
12
13
14
# File 'lib/moco/compilers/sass_compiler.rb', line 9

def compiled_text
  Sass::Engine.new(source_text, options).render
rescue => e
  e.instance_eval { alias :line :sass_line } if defined? e.sass_line
  raise
end

#optionsObject



16
17
18
19
20
21
# File 'lib/moco/compilers/sass_compiler.rb', line 16

def options
  { :syntax     => (source_file =~ /\.sass$/) ? :sass : :scss,
    :cache      => false,
    :read_cache => false
  }.merge(super)
end