Module: Edaemon::Helper::Process

Defined in:
lib/edaemon/helper/process.rb

Class Method Summary collapse

Class Method Details

.listObject

:nocov:



6
7
8
# File 'lib/edaemon/helper/process.rb', line 6

def list
  `ps ax`.split("\n")
end

.pidsObject

:nocov:



11
12
13
14
15
16
17
18
# File 'lib/edaemon/helper/process.rb', line 11

def pids
  list.map { |row| row.scan(/\A {0,}([0-9]{1,})/) }
      .flatten
      .compact
      .uniq
      .map(&:to_i)
      .sort
end