Sha256: 9f38711039d72e173ba6224570c266231a3bac54512f1a8184583cdbfa04a24a
Contents?: true
Size: 412 Bytes
Versions: 7
Compression:
Stored size: 412 Bytes
Contents
module Process ## # Check if process _pid_ is alive. Where _pid_ # may be a pidfile path, or an integer. def self.alive? pid pid = pid_from_file(pid) if String === pid Process.kill 0, pid if Numeric === pid rescue Errno::ESRCH end ## # Get pid integer from pidfile at _path_. def self.pid_from_file path if File.exists? path File.read(path).to_i end end end
Version data entries
7 entries across 7 versions & 1 rubygems