From ece275a05439e5d28849c354af67f451f35e3d81 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 22 Apr 2011 09:27:51 -0700 Subject: [PATCH] Reset the memory cache before each watcher run. --- lib/compass/commands/watch_project.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/compass/commands/watch_project.rb b/lib/compass/commands/watch_project.rb index 668b6b81..7a079b74 100644 --- a/lib/compass/commands/watch_project.rb +++ b/lib/compass/commands/watch_project.rb @@ -62,15 +62,16 @@ module Compass end unless Compass.sass_engine_options[:cache_store] + @memory_cache = Sass::CacheStores::Memory.new Compass.configuration.sass_options ||= {} - Compass.configuration.sass_options[:cache_store] = - Sass::CacheStores::Chain.new( - Sass::CacheStores::Memory.new, - Sass::CacheStores::Filesystem.new( - Compass.sass_engine_options[:cache_location] || - Sass::Engine::DEFAULT_OPTIONS[:cache_location] - ) + Sass::CacheStores::Chain.new( + @memory_cache, + Sass::CacheStores::Filesystem.new( + Compass.sass_engine_options[:cache_location] || + Sass::Engine::DEFAULT_OPTIONS[:cache_location] ) + ) + end check_for_sass_files!(new_compiler_instance) @@ -136,6 +137,7 @@ module Compass end def recompile(base = nil, relative = nil) + @memory_cache.reset! if @memory_cache compiler = new_compiler_instance(:quiet => true) if file = compiler.out_of_date? begin