[Command Line] Respect the --dry-run option during compilation.

This commit is contained in:
Chris Eppstein 2010-05-30 07:02:07 -07:00
parent 98e291fa2b
commit 9f561e97cb
2 changed files with 24 additions and 3 deletions

View File

@ -111,6 +111,23 @@ Feature: Command Line
And a css file tmp_compass/tmp/reset.css is created And a css file tmp_compass/tmp/reset.css is created
And a css file tmp_compass/tmp/utilities.css is created And a css file tmp_compass/tmp/utilities.css is created
Scenario: Dry Run of Compiling an existing project.
Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile --dry-run
Then a directory tmp/ is not created
And a sass file sass/layout.sass is reported compiled
And a sass file sass/print.sass is reported compiled
And a sass file sass/reset.sass is reported compiled
And a sass file sass/utilities.sass is reported compiled
And a css file tmp/layout.css is not created
And a css file tmp/print.css is not created
And a css file tmp/reset.css is not created
And a css file tmp/utilities.css is not created
And a css file tmp/layout.css is reported created
And a css file tmp/print.css is reported created
And a css file tmp/reset.css is reported created
And a css file tmp/utilities.css is reported created
Scenario: Recompiling a project with no changes Scenario: Recompiling a project with no changes
Given I am using the existing project in test/fixtures/stylesheets/compass Given I am using the existing project in test/fixtures/stylesheets/compass
When I run: compass compile When I run: compass compile

View File

@ -46,12 +46,16 @@ module Compass
end end
def new_compiler_instance(additional_options = {}) def new_compiler_instance(additional_options = {})
compiler_opts = Compass.sass_engine_options
compiler_opts.merge!(:quiet => options[:quiet],
:force => options[:force],
:sass_files => explicit_sass_files,
:dry_run => options[:dry_run])
compiler_opts.merge!(additional_options)
Compass::Compiler.new(working_path, Compass::Compiler.new(working_path,
projectize(Compass.configuration.sass_dir), projectize(Compass.configuration.sass_dir),
projectize(Compass.configuration.css_dir), projectize(Compass.configuration.css_dir),
Compass.sass_engine_options.merge(:quiet => options[:quiet], compiler_opts)
:force => options[:force],
:sass_files => explicit_sass_files).merge(additional_options))
end end
def explicit_sass_files def explicit_sass_files