Permalink
Browse files

Notify when compilation is skipped because it was already compiled wi…

…th that option.
  • Loading branch information...
1 parent 3d8f323 commit 35f82f4ead8ff5eaab175c6424e57b0d3c560e89 @smellsblue committed May 28, 2012
Showing with 7 additions and 1 deletion.
  1. +6 −1 lib/nginxtra/actions/compile.rb
  2. +1 −0 spec/compile_spec.rb
@@ -10,7 +10,7 @@ def initialize(thor, config)
# Run the full compilation of nginx.
def compile
- return unless should_compile?
+ return up_to_date unless should_compile?
configure
make
make "install"
@@ -44,6 +44,11 @@ def update_last_compile!
Nginxtra::Status[:last_compile_options] = @config.compile_options
Nginxtra::Status[:last_compile_time] = Time.now
end
+
+ # Notify the user that the compilation is up to date
+ def up_to_date
+ @thor.say "nginx compilation is up to date"
+ end
end
end
end
View
@@ -37,6 +37,7 @@
Nginxtra::Status.stub(:[]).with(:last_compile_options).and_return("--option1 --option2")
thor_mock.should_not_receive(:inside)
thor_mock.should_not_receive(:run)
+ thor_mock.should_receive(:say).with("nginx compilation is up to date")
Nginxtra::Status.should_not_receive(:[]=)
Nginxtra::Actions::Compile.new(thor_mock, config_mock).compile
end

0 comments on commit 35f82f4

Please sign in to comment.