class Shutup::Server

Public Class Methods

current_dir() click to toggle source
# File lib/shutup/server.rb, line 4
def current_dir
  File.expand_path(File.dirname('.'))
end
delete_pid() click to toggle source
# File lib/shutup/server.rb, line 29
def delete_pid
  File.delete(pid_file) if File.exist?(pid_file)
end
hit!() click to toggle source
# File lib/shutup/server.rb, line 21
def hit!
  if pid
    system "kill -9 #{pid}"
    puts "Killed process id: #{pid}"
    true
  end
end
pid() click to toggle source
# File lib/shutup/server.rb, line 12
def pid
  begin
    File.read(pid_file)
  rescue => e
    puts "Error reading the pid file."
    system "cat #{pid_file}"
  end
end
pid_file() click to toggle source
# File lib/shutup/server.rb, line 8
def pid_file
  "#{current_dir}/tmp/pids/server.pid"
end