Skip to content

Instantly share code, notes, and snippets.

@marugoshi
Created March 14, 2011 15:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marugoshi/869286 to your computer and use it in GitHub Desktop.
Save marugoshi/869286 to your computer and use it in GitHub Desktop.
Start, stop, restart spork rake task
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
@brauliobo
Copy link

simple but more reliable at https://gist.github.com/2870684

@marugoshi
Copy link
Author

agreed your script is more reliable. I switched to guard but if I have a chance, I'm gonna try. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment