module Process

Process Premium Version + Crack + Serial + two new methods

Public Class Methods

die_with_parent() click to toggle source

Create a thread to kill the current process if the parent process die

# 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) click to toggle source

Verify if a process is running

# 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