Created
March 14, 2011 15:15
-
-
Save marugoshi/869286 to your computer and use it in GitHub Desktop.
Start, stop, restart spork rake task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spork do | |
desc "start spork in background" | |
task :start do | |
sh %{spork &} | |
end | |
desc "stop spork" | |
task :stop do | |
Process.kill(:TERM, `ps -ef | grep spork | grep -v grep | awk '{ print $2 }'`.to_i) | |
end | |
desc "restart spork" | |
task :restart => [:stop, :start] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
agreed your script is more reliable. I switched to guard but if I have a chance, I'm gonna try. Thanks!