Permalink
Browse files

Update lib/san_juan.rb

  • Loading branch information...
1 parent 61f84ec commit 6df5b8e4a8fe4ed021cda16b1885ec40bbd9c68f @TeaMoe committed May 23, 2012
Showing with 11 additions and 7 deletions.
  1. +11 −7 lib/san_juan.rb
View
@@ -48,40 +48,40 @@ def role(role, watches)
namespace role do
desc "Start god"
task :start, :roles => role do
- run "bundle exec god -c #{san_juan.configuration_path(current_path, role)}"
+ bundle_exec "god -c #{san_juan.configuration_path(current_path, role)}"
end
desc "Start god interactively"
task :start_interactive, :roles => role do
- run "bundle exec god -c #{san_juan.configuration_path(current_path, role)} -D"
+ bundle_exec "god -c #{san_juan.configuration_path(current_path, role)} -D"
end
desc "Reload the god config file"
task :reload, :roles => role do
- run "bundle exec god load #{san_juan.configuration_path(current_path, role)}"
+ bundle_exec "god load #{san_juan.configuration_path(current_path, role)}"
end
desc "Quit god, but not the processes it's monitoring"
task :quit, :roles => role do
- run 'bundle exec god quit'
+ bundle_exec 'god quit'
end
desc "Terminate god and all monitored processes"
task :terminate, :roles => role do
- run 'bundle exec god terminate'
+ bundle_exec 'god terminate'
end
desc "Describe the status of the running tasks"
task :status, :roles => role do
- run 'bundle exec god status'
+ bundle_exec 'god status'
end
watches.each do |watch|
namespace watch do
%w(start restart stop unmonitor remove log).each do |command|
desc "#{command.capitalize} #{watch}"
task command, :roles => role do
- run "bundle exec god #{command} #{watch}"
+ bundle_exec "god #{command} #{watch}"
end
end
end
@@ -95,6 +95,10 @@ def role(role, watches)
def configuration_path(current_path, role)
fetch(:god_config_path, nil) || "#{current_path}/config/god/#{role}.god"
end
+
+ def bundle_exec(command)
+ run "cd #{current_path} && bundle exec #{command}"
+ end
end
Capistrano.plugin :san_juan, SanJuan

0 comments on commit 6df5b8e

Please sign in to comment.