Files
railsgoat/lib/tasks/server.rake
T
robbiepaul 298610b5f6
CI / test (3.4.1) (push) Has been cancelled
Initial commit (history cleared)
2026-04-29 11:21:39 +01:00

24 lines
527 B
Ruby

# frozen_string_literal: true
namespace :server do
desc "Start Rails"
task :start do
pid_file = "tmp/pids/server.pid"
if !(File.exist?(pid_file))
sh("rails s -d")
else
puts "[+] Server is already running"
end
end
desc "Stop Rails"
task :stop do
pid_file = "tmp/pids/server.pid"
if File.exist?(pid_file)
Process.kill("INT", File.read(pid_file).to_i)
else
puts "[-] Server isn't running"
end
end
end