Fixes to make the environment setting work correctly with configuration files and to correctly pass the :line_comments option to Sass::Engine.
This commit is contained in:
parent
a711197b2a
commit
1991f729f0
@ -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])
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user