Sass and compass both have :quiet options with different meanings. So we have to separate the options out.

This commit is contained in:
Chris Eppstein 2011-06-11 15:44:00 -07:00
parent 59a6d5706d
commit 5999c7ba6c
2 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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