Class: SassC::Engine
- Inherits:
-
Object
- Object
- SassC::Engine
- Defined in:
- lib/sassc/engine.rb
Defined Under Namespace
Classes: NotRenderedError
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(template, options = {}) ⇒ Engine
constructor
A new instance of Engine.
- #render ⇒ Object
Constructor Details
#initialize(template, options = {}) ⇒ Engine
Returns a new instance of Engine.
5 6 7 8 |
# File 'lib/sassc/engine.rb', line 5 def initialize(template, = {}) @template = template = end |
Instance Method Details
#dependencies ⇒ Object
39 40 41 42 |
# File 'lib/sassc/engine.rb', line 39 def dependencies raise NotRenderedError unless @dependencies Dependency.from_filenames(@dependencies) end |
#render ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/sassc/engine.rb', line 10 def render data_context = Native.make_data_context(@template) context = Native.data_context_get_context(data_context) = Native.(context) Native.option_set_is_indented_syntax_src(, true) if sass? Native.option_set_input_path(, filename) if filename Native.option_set_include_path(, load_paths) importer.setup() if importer status = Script.setup_custom_functions(, ) do Native.compile_data_context(data_context) end css = Native.context_get_output_string(context) if status != 0 = SassC::Native.(context) raise SyntaxError.new() end @dependencies = Native.context_get_included_files(context) Native.delete_data_context(data_context) return css unless quiet? end |