From 46146035580cde3f6f8f50129e24c2f83624ff57 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 24 Dec 2009 12:29:13 -0800 Subject: [PATCH] [Sass] Actually, we don't need to manually set that default option. The options are already merged into DEFAULT_OPTIONS, and no one should be setting it to nil explicitly. --- doc-src/SASS_CHANGELOG.md | 3 --- lib/sass/files.rb | 2 +- test/sass/plugin_test.rb | 15 --------------- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index bd1bcb3b77..c13e8dc1a6 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -20,9 +20,6 @@ {Sass::Script::Functions::EvaluationContext Functions::EvaluationContext}). Now the module simply needs to be included in {Sass::Script::Functions}. -* Fixed a bug where {Sass::Plugin} would die if caching was enabled - but the cache location wasn't explicitly set. - ## [2.2.15](http://github.com/nex3/haml/commit/2.2.15) * Added {Sass::Script::Color#with} for a way of setting color channels diff --git a/lib/sass/files.rb b/lib/sass/files.rb index 627ad10171..94056ee921 100644 --- a/lib/sass/files.rb +++ b/lib/sass/files.rb @@ -84,7 +84,7 @@ def find_file_to_import(filename, load_paths) private def sassc_filename(filename, options) - File.join(options[:cache_location] || Sass::Engine::DEFAULT_OPTIONS[:cache_location], + File.join(options[:cache_location], Digest::SHA1.hexdigest(File.dirname(File.expand_path(filename))), File.basename(filename) + 'c') end diff --git a/test/sass/plugin_test.rb b/test/sass/plugin_test.rb index c327d3eb93..c1553a8f37 100644 --- a/test/sass/plugin_test.rb +++ b/test/sass/plugin_test.rb @@ -138,21 +138,6 @@ def test_cached_dependencies_update FileUtils.mv(template_loc("basic", "more_"), template_loc("basic")) end - def test_update_with_cache_but_without_cache_location - old_cache = Sass::Plugin.options[:cache] - old_cache_location = Sass::Plugin.options[:cache_location] - Sass::Plugin.options[:cache] = true - Sass::Plugin.options[:cache_location] = nil - - # We just want to make sure this doesn't raise an exception - FileUtils.touch(template_loc('basic')) - Sass::Plugin.update_stylesheets - assert_stylesheet_updated 'basic' - ensure - Sass::Plugin.options[:cache] = old_cache - Sass::Plugin.options[:cache_location] = old_cache_location - end - private def assert_renders_correctly(*arguments)