From 1991f729f021814f8852e4a7495706af64540d84 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 1 Apr 2009 17:24:36 -0700 Subject: [PATCH] Fixes to make the environment setting work correctly with configuration files and to correctly pass the :line_comments option to Sass::Engine. --- lib/compass/actions.rb | 3 ++- lib/compass/configuration.rb | 6 ++++++ lib/compass/exec.rb | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/compass/actions.rb b/lib/compass/actions.rb index 63aaa9cf..acb18f93 100644 --- a/lib/compass/actions.rb +++ b/lib/compass/actions.rb @@ -53,10 +53,11 @@ module Compass # Compile one Sass file def compile(sass_filename, css_filename, options) + puts options.inspect logger.record :compile, basename(sass_filename) engine = ::Sass::Engine.new(open(sass_filename).read, :filename => sass_filename, - :line_comments => options[:environment] == :development, + :line_comments => options[:line_comments], :style => options[:style], :css_filename => css_filename, :load_paths => options[:load_paths]) diff --git a/lib/compass/configuration.rb b/lib/compass/configuration.rb index 1f63c964..b9b5bc33 100644 --- a/lib/compass/configuration.rb +++ b/lib/compass/configuration.rb @@ -81,6 +81,10 @@ module Compass end end + def default_line_comments + environment == :development + end + def serialize contents = "" required_libraries.each do |lib| @@ -110,12 +114,14 @@ module Compass end plugin_opts = {:template_location => locations} plugin_opts[:style] = output_style if output_style + engine_opts[:line_comments] = default_line_comments if environment plugin_opts end def to_sass_engine_options engine_opts = {:load_paths => sass_load_paths} engine_opts[:style] = output_style if output_style + engine_opts[:line_comments] = default_line_comments if environment engine_opts end diff --git a/lib/compass/exec.rb b/lib/compass/exec.rb index 4993b81f..724a327f 100644 --- a/lib/compass/exec.rb +++ b/lib/compass/exec.rb @@ -72,7 +72,6 @@ module Compass self.options[:project_name] = trim_trailing_separator(self.args.shift) end self.options[:command] ||= self.options[:project_name] ? :create_project : :update_project - self.options[:environment] ||= :production self.options[:framework] ||= :compass self.options[:project_type] ||= :stand_alone end