diff --git a/lib/sassc/engine.rb b/lib/sassc/engine.rb index 4bef7c5d..9726eeaf 100644 --- a/lib/sassc/engine.rb +++ b/lib/sassc/engine.rb @@ -49,6 +49,7 @@ def render css = Native.context_get_output_string(context) @dependencies = Native.context_get_included_files(context) + @source_map = Native.context_get_source_map_string(context) Native.delete_data_context(data_context) @@ -62,6 +63,11 @@ def dependencies Dependency.from_filenames(@dependencies) end + def source_map + raise NotRenderedError unless @source_map + @source_map + end + def filename @options[:filename] end diff --git a/test/engine_test.rb b/test/engine_test.rb index 23a886e9..04ab19d2 100644 --- a/test/engine_test.rb +++ b/test/engine_test.rb @@ -121,6 +121,51 @@ def test_not_rendered_error assert_raises(NotRenderedError) { engine.dependencies } end + def test_source_map + temp_dir('admin') + + temp_file('admin/text-color.scss', <