Method: Rush::Connection::Local#parse_ps

Defined in:
lib/rush/local.rb

#parse_ps(line) ⇒ Object

Parse a single line of the ps command and return the values in a hash suitable for use in the Rush::Process#new.



228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/rush/local.rb', line 228

def parse_ps(line)
  m = line.split(" ", 6)
  {
    pid: m[0],
    uid: m[1],
    parent_pid: m[2].to_i,
    mem: m[3].to_i,
    cpu: m[4].to_i,
    cmdline: m[5],
    command: m[5].split(' ').first
  }
end