module Process

Public Class Methods

create_pid(path) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 9
def create_pid(path)
  Pathname(path).write(Process.pid)
end
exists?(pid) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 2
def exists?(pid)
  Process.kill(0, pid)
  true
rescue => e
  false
end
get_pid(path) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 13
def get_pid(path)
  File.read(path).to_i
rescue Errno::ENOENT
  false
end
remove_pidfile(path) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 19
def remove_pidfile(path)
  File.delete(path)
rescue Errno::ENOENT
  false
end

Private Instance Methods

create_pid(path) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 9
def create_pid(path)
  Pathname(path).write(Process.pid)
end
exists?(pid) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 2
def exists?(pid)
  Process.kill(0, pid)
  true
rescue => e
  false
end
get_pid(path) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 13
def get_pid(path)
  File.read(path).to_i
rescue Errno::ENOENT
  false
end
remove_pidfile(path) click to toggle source
# File lib/rooftop/spektrix_sync/process.rb, line 19
def remove_pidfile(path)
  File.delete(path)
rescue Errno::ENOENT
  false
end