From 4c814f97dd703782386d72905f5035ce5d763a67 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 20 Apr 2011 19:26:07 -0700 Subject: [PATCH] Use Sass's Chain and Memory caching for faster caching, store this once in the configuration when watching so Sass doesn't do this with each iteration. --- lib/compass/commands/watch_project.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/compass/commands/watch_project.rb b/lib/compass/commands/watch_project.rb index 1a3fd66c..fea0cfb4 100644 --- a/lib/compass/commands/watch_project.rb +++ b/lib/compass/commands/watch_project.rb @@ -36,11 +36,24 @@ module Compass exit 0 end + unless Compass.sass_engine_options[:cache_store] + 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] + ) + ) + end + check_for_sass_files!(new_compiler_instance) recompile require 'fssm' + if options[:poll] require "fssm/backends/polling" # have to silence the ruby warning about chaning a constant.