Sha256: 700e2ee29b5c44e15624d0676442e370a849cc187708be30ef1b0eb64df7c149
Contents?: true
Size: 757 Bytes
Versions: 15
Compression:
Stored size: 757 Bytes
Contents
# encoding: utf-8 module LocalPac module Actions class SendSignal private attr_reader :signal, :pid_file, :signalizer public def initialize(signal, pid_file = LocalPac.config.pid_file, signalizer = Process) @signal = signal @pid_file = pid_file @signalizer = signalizer end def run signalizer.kill signal, pid rescue Exceptions::PidFileDoesNotExist LocalPac.ui_logger.error "Pid-file \"#{pid_file}\" does not exist. I'm not able to send daemon signal \"#{signal}\"." end private def pid ::File.read(pid_file).to_i rescue Errno::ENOENT => e raise Exceptions::PidFileDoesNotExist, e.message end end end end
Version data entries
15 entries across 15 versions & 1 rubygems