Class: Shutup::Rails
- Inherits:
-
Object
- Object
- Shutup::Rails
- Defined in:
- lib/shutup.rb
Instance Method Summary collapse
Instance Method Details
#current_dir ⇒ Object
4 5 6 |
# File 'lib/shutup.rb', line 4 def current_dir File.(File.dirname(File.dirname('.'))) end |
#hit! ⇒ Object
21 22 23 24 25 26 |
# File 'lib/shutup.rb', line 21 def hit! if pid system "kill -9 #{pid}" puts "Killed process id: #{pid}" end end |
#pid ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/shutup.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.rb', line 8 def pid_file "#{current_dir}/tmp/pids/server.pid" end |