From 5f1c35d1717dac8872a4c75c8f1844377f975a65 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 20 Apr 2011 19:23:21 -0700 Subject: [PATCH] Only compute the sass engine options once in the update_project command -- this is called repeatedly by the watcher command. --- lib/compass/commands/update_project.rb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/compass/commands/update_project.rb b/lib/compass/commands/update_project.rb index 7ce101f2..9c47fa5c 100644 --- a/lib/compass/commands/update_project.rb +++ b/lib/compass/commands/update_project.rb @@ -49,17 +49,20 @@ module Compass end def new_compiler_instance(additional_options = {}) - compiler_opts = Compass.sass_engine_options - compiler_opts.merge!(:force => options[:force], - :sass_files => explicit_sass_files, - :dry_run => options[:dry_run]) - compiler_opts[:quiet] = options[:quiet] if options[:quiet] - compiler_opts[:time] = options[:time] if options[:time] - compiler_opts.merge!(additional_options) + @compiler_opts ||= begin + compiler_opts = Compass.sass_engine_options + compiler_opts.merge!(:force => options[:force], + :sass_files => explicit_sass_files, + :dry_run => options[:dry_run]) + compiler_opts[:quiet] = options[:quiet] if options[:quiet] + compiler_opts[:time] = options[:time] if options[:time] + Sass::Engine.normalize_options(compiler_opts) + end + Compass::Compiler.new(working_path, Compass.configuration.sass_path, Compass.configuration.css_path, - compiler_opts) + @compiler_opts.merge(additional_options)) end def explicit_sass_files