Module: Process
- Defined in:
- lib/beanpicker/process.rb
Overview
Process Premium Version + Crack + Serial + two new methods
Class Method Summary collapse
-
.die_with_parent ⇒ Object
Create a thread to kill the current process if the parent process die.
-
.running?(pid) ⇒ Boolean
Verify if a process is running.
Class Method Details
.die_with_parent ⇒ Object
Create a thread to kill the current process if the parent process die
15 16 17 18 19 20 21 22 |
# File 'lib/beanpicker/process.rb', line 15 def self.die_with_parent Thread.new do while Process.running?(Process.ppid) sleep 1 end Kernel.exit end end |
.running?(pid) ⇒ Boolean
Verify if a process is running
5 6 7 8 9 10 11 12 |
# File 'lib/beanpicker/process.rb', line 5 def self.running?(pid) begin Process.kill 0, pid return true rescue Errno::ESRCH, Errno::EPERM return false end end |