added a task for stopping and starting rails

This commit is contained in:
cktricky
2013-08-08 16:17:55 -04:00
parent 1b9e60b982
commit 9533f0d098
+17
View File
@@ -0,0 +1,17 @@
namespace :server do
desc "Start Rails"
task :start do
sh("rails s -d")
end
desc "Stop Rails"
task :stop do
pid_file = "tmp/pids/server.pid"
if File.exists?(pid_file)
Process.kill("INT", File.read(pid_file).to_i)
else
puts "[-] Server isn't running"
end
end
end