Permalink
Browse files

adding better user feedback messages when not stopping/starting rabbitmq

  • Loading branch information...
1 parent 1d634a1 commit 3fe5b7e200f4f9c84c231d14ea900a3b50a2d8cc @rick committed Nov 26, 2008
Showing with 11 additions and 3 deletions.
  1. +1 −1 spec/rake/rabbitmq.rake_spec.rb
  2. +10 −2 tasks/rabbitmq.rake
@@ -4,7 +4,7 @@
require 'mq'
describe 'rake tasks to control rabbitmq server' do
- before :each do
+ before :each do
Rake.application = @rake = Rake::Application.new
load File.expand_path(File.dirname(__FILE__) + '/../../tasks/rabbitmq.rake')
end
View
@@ -66,13 +66,21 @@ namespace :rabbitmq do
task :start do
raise "RabbitMQ server is not installed -- please run 'rake install_dependencies' first." unless
RakeInstall.is_installed?('run/rabbitmq')
- RabbitMQ.start unless RabbitMQ.running?
+ if RabbitMQ.running?
+ puts "RabbitMQ server is already running."
+ else
+ RabbitMQ.start
+ end
end
desc 'stop the rabbitmq server'
task :stop do
raise "RabbitMQ server is not installed -- please run 'rake install_dependencies' first." unless
RakeInstall.is_installed?('run/rabbitmq')
- RabbitMQ.stop if RabbitMQ.running?
+ if RabbitMQ.running?
+ RabbitMQ.stop
+ else
+ puts "RabbitMQ server is not running."
+ end
end
end

0 comments on commit 3fe5b7e

Please sign in to comment.