From 5999c7ba6c8b2b519a802a8b11199bdad8aa800d Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 11 Jun 2011 15:44:00 -0700 Subject: [PATCH] Sass and compass both have :quiet options with different meanings. So we have to separate the options out. --- lib/compass/commands/update_project.rb | 9 +++------ lib/compass/compiler.rb | 13 ++++++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/compass/commands/update_project.rb b/lib/compass/commands/update_project.rb index 1eb0a595..d570da2f 100644 --- a/lib/compass/commands/update_project.rb +++ b/lib/compass/commands/update_project.rb @@ -51,12 +51,9 @@ module Compass def new_compiler_instance(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] + compiler_opts = {:sass => Compass.sass_engine_options} + compiler_opts.merge!(options) + compiler_opts[:sass_files] = explicit_sass_files compiler_opts end diff --git a/lib/compass/compiler.rb b/lib/compass/compiler.rb index e7f6feef..961a4624 100644 --- a/lib/compass/compiler.rb +++ b/lib/compass/compiler.rb @@ -3,16 +3,19 @@ module Compass include Actions - attr_accessor :working_path, :from, :to, :options, :staleness_checker, :importer + attr_accessor :working_path, :from, :to, :options, :sass_options, :staleness_checker, :importer def initialize(working_path, from, to, options) self.working_path = working_path self.from, self.to = from.gsub('./', ''), to self.logger = options.delete(:logger) + sass_opts = options.delete(:sass) || {} self.options = options - self.options[:cache_location] ||= determine_cache_location - options[:importer] = self.importer = Sass::Importers::Filesystem.new(from) - self.staleness_checker = Sass::Plugin::StalenessChecker.new(options) + self.sass_options = options.dup + self.sass_options.update(sass_opts) + self.sass_options[:cache_location] ||= determine_cache_location + self.sass_options[:importer] = self.importer = Sass::Importers::Filesystem.new(from) + self.staleness_checker = Sass::Plugin::StalenessChecker.new(sass_options) end def determine_cache_location @@ -142,7 +145,7 @@ module Compass # A sass engine for compiling a single file. def engine(sass_filename, css_filename) syntax = (sass_filename =~ /\.(s[ac]ss)$/) && $1.to_sym || :sass - opts = options.merge :filename => sass_filename, :css_filename => css_filename, :syntax => syntax + opts = sass_options.merge(:filename => sass_filename, :css_filename => css_filename, :syntax => syntax) Sass::Engine.new(open(sass_filename).read, opts) end