Mocks the sys-proctable gem using ps.
This is useful even if sys-proctable is available, because it may fail for random reasons.
Classes: ProcInfo
14 15 16 17 18 19 20 21 22 23
# File 'lib/daemonz/process.rb', line 14 def self.ps_emulation retval = [] ps_output = `ps ax` ps_output.each_line do |pline| pdata = pline.split(nil, 5) pinfo = ProcInfo.new(pdata[0].strip, pdata[4].strip) retval << pinfo end return retval end