Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow capistrano recipes to be loaded from the gem.

Add the following in your capistrano config to load the recipes:

  require 'delayed/recipes'
commit f5871850dad913fe56252a7f0333affcfb9644eb 1 parent 94be113
Brandon Keepers bkeepers authored
Showing with 28 additions and 26 deletions.
  1. +27 −0 lib/delayed/recipes.rb
  2. +1 −26 recipes/delayed_job.rb
27 lib/delayed/recipes.rb
View
@@ -0,0 +1,27 @@
+# Capistrano Recipes for managing delayed_job
+#
+# Add these callbacks to have the delayed_job process restart when the server
+# is restarted:
+#
+# after "deploy:stop", "delayed_job:stop"
+# after "deploy:start", "delayed_job:start"
+# after "deploy:restart", "delayed_job:restart"
+
+Capistrano::Configuration.instance.load do
+ namespace :delayed_job do
+ desc "Stop the delayed_job process"
+ task :stop, :roles => :app do
+ run "cd #{current_path}; script/delayed_job -e #{rails_env} stop"
+ end
+
+ desc "Start the delayed_job process"
+ task :start, :roles => :app do
+ run "cd #{current_path}; script/delayed_job -e #{rails_env} start"
+ end
+
+ desc "Restart the delayed_job process"
+ task :restart, :roles => :app do
+ run "cd #{current_path}; script/delayed_job -e #{rails_env} restart"
+ end
+ end
+end
27 recipes/delayed_job.rb
View
@@ -1,26 +1 @@
-# Capistrano Recipes for managing delayed_job
-#
-# Add these callbacks to have the delayed_job process restart when the server
-# is restarted:
-#
-# after "deploy:stop", "delayed_job:stop"
-# after "deploy:start", "delayed_job:start"
-# after "deploy:restart", "delayed_job:restart"
-
-
-namespace :delayed_job do
- desc "Stop the delayed_job process"
- task :stop, :roles => :app do
- run "cd #{current_path}; script/delayed_job -e #{rails_env} stop"
- end
-
- desc "Start the delayed_job process"
- task :start, :roles => :app do
- run "cd #{current_path}; script/delayed_job -e #{rails_env} start"
- end
-
- desc "Restart the delayed_job process"
- task :restart, :roles => :app do
- run "cd #{current_path}; script/delayed_job -e #{rails_env} restart"
- end
-end
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'delayed', 'recipes'))
Please sign in to comment.
Something went wrong with that request. Please try again.