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
|
# Compile one Sass file
|
||||||
def compile(sass_filename, css_filename, options)
|
def compile(sass_filename, css_filename, options)
|
||||||
|
puts options.inspect
|
||||||
logger.record :compile, basename(sass_filename)
|
logger.record :compile, basename(sass_filename)
|
||||||
engine = ::Sass::Engine.new(open(sass_filename).read,
|
engine = ::Sass::Engine.new(open(sass_filename).read,
|
||||||
:filename => sass_filename,
|
:filename => sass_filename,
|
||||||
:line_comments => options[:environment] == :development,
|
:line_comments => options[:line_comments],
|
||||||
:style => options[:style],
|
:style => options[:style],
|
||||||
:css_filename => css_filename,
|
:css_filename => css_filename,
|
||||||
:load_paths => options[:load_paths])
|
:load_paths => options[:load_paths])
|
||||||
|
@ -81,6 +81,10 @@ module Compass
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def default_line_comments
|
||||||
|
environment == :development
|
||||||
|
end
|
||||||
|
|
||||||
def serialize
|
def serialize
|
||||||
contents = ""
|
contents = ""
|
||||||
required_libraries.each do |lib|
|
required_libraries.each do |lib|
|
||||||
@ -110,12 +114,14 @@ module Compass
|
|||||||
end
|
end
|
||||||
plugin_opts = {:template_location => locations}
|
plugin_opts = {:template_location => locations}
|
||||||
plugin_opts[:style] = output_style if output_style
|
plugin_opts[:style] = output_style if output_style
|
||||||
|
engine_opts[:line_comments] = default_line_comments if environment
|
||||||
plugin_opts
|
plugin_opts
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_sass_engine_options
|
def to_sass_engine_options
|
||||||
engine_opts = {:load_paths => sass_load_paths}
|
engine_opts = {:load_paths => sass_load_paths}
|
||||||
engine_opts[:style] = output_style if output_style
|
engine_opts[:style] = output_style if output_style
|
||||||
|
engine_opts[:line_comments] = default_line_comments if environment
|
||||||
engine_opts
|
engine_opts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ module Compass
|
|||||||
self.options[:project_name] = trim_trailing_separator(self.args.shift)
|
self.options[:project_name] = trim_trailing_separator(self.args.shift)
|
||||||
end
|
end
|
||||||
self.options[:command] ||= self.options[:project_name] ? :create_project : :update_project
|
self.options[:command] ||= self.options[:project_name] ? :create_project : :update_project
|
||||||
self.options[:environment] ||= :production
|
|
||||||
self.options[:framework] ||= :compass
|
self.options[:framework] ||= :compass
|
||||||
self.options[:project_type] ||= :stand_alone
|
self.options[:project_type] ||= :stand_alone
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user