From 802bca61741db31da7131c82d31fff45f9323696 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 27 Jun 2009 13:05:30 -0700 Subject: [PATCH] [Configuration] Allow additional sass options to be specified in the compass configuration using the sass_options property. --- lib/compass/configuration.rb | 6 ++++-- test/configuration_test.rb | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/compass/configuration.rb b/lib/compass/configuration.rb index 60213235..dc00cd45 100644 --- a/lib/compass/configuration.rb +++ b/lib/compass/configuration.rb @@ -14,7 +14,8 @@ module Compass :output_style, :environment, :http_images_path, - :additional_import_paths + :additional_import_paths, + :sass_options ] attr_accessor *ATTRIBUTES @@ -206,6 +207,7 @@ module Compass plugin_opts = {:template_location => locations} plugin_opts[:style] = output_style if output_style plugin_opts[:line_comments] = default_line_comments if environment + plugin_opts.merge!(sass_options || {}) plugin_opts end @@ -223,7 +225,7 @@ module Compass engine_opts = {:load_paths => sass_load_paths} engine_opts[:style] = output_style if output_style engine_opts[:line_comments] = default_line_comments if environment - engine_opts + engine_opts.merge!(sass_options || {}) end def sass_load_paths diff --git a/test/configuration_test.rb b/test/configuration_test.rb index 7b31282e..5a6f0737 100644 --- a/test/configuration_test.rb +++ b/test/configuration_test.rb @@ -89,4 +89,23 @@ EXPECTED assert_equal expected_serialization, Compass.configuration.serialize end + def test_sass_options + contents = <<-CONFIG + sass_options = {:foo => 'bar'} + CONFIG + + Compass.configuration.parse_string(contents, "test_sass_options") + + assert_equal 'bar', Compass.configuration.to_sass_engine_options[:foo] + assert_equal 'bar', Compass.configuration.to_sass_plugin_options[:foo] + + expected_serialization = <"bar"} +EXPECTED + assert_equal expected_serialization, Compass.configuration.serialize + end + end \ No newline at end of file