Permalink
Browse files

[Configuration] Allow additional sass options to be specified in the …

…compass configuration using the sass_options property.
  • Loading branch information...
chriseppstein committed Jun 27, 2009
1 parent 047be06 commit 802bca61741db31da7131c82d31fff45f9323696
Showing with 23 additions and 2 deletions.
  1. +4 −2 lib/compass/configuration.rb
  2. +19 −0 test/configuration_test.rb
@@ -14,7 +14,8 @@ class Configuration
:output_style,
:environment,
:http_images_path,
:additional_import_paths
:additional_import_paths,
:sass_options
]
attr_accessor *ATTRIBUTES
@@ -206,6 +207,7 @@ def to_sass_plugin_options
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 @@ def to_sass_engine_options
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
View
@@ -89,4 +89,23 @@ def test_additional_import_paths
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 = <<EXPECTED
# Require any additional compass plugins here.
# To enable relative image paths using the images_url() function:
# http_images_path = :relative
sass_options = {:foo=>"bar"}
EXPECTED
assert_equal expected_serialization, Compass.configuration.serialize
end
end

0 comments on commit 802bca6

Please sign in to comment.