Class: Shutup::Server
- Inherits:
-
Object
- Object
- Shutup::Server
- Defined in:
- lib/shutup/server.rb
Class Method Summary collapse
Class Method Details
.current_dir ⇒ Object
4 5 6 |
# File 'lib/shutup/server.rb', line 4 def current_dir File.(File.dirname('.')) end |
.delete_pid ⇒ Object
29 30 31 |
# File 'lib/shutup/server.rb', line 29 def delete_pid File.delete(pid_file) if File.exist?(pid_file) end |
.hit! ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/shutup/server.rb', line 21 def hit! if pid system "kill -9 #{pid}" puts "Killed process id: #{pid}" true end end |
.pid ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/shutup/server.rb', line 12 def pid begin File.read(pid_file) rescue => e e. << ' Are you sure that the process is running?' raise(e) end end |
.pid_file ⇒ Object
8 9 10 |
# File 'lib/shutup/server.rb', line 8 def pid_file "#{current_dir}/tmp/pids/server.pid" end |