Module: Edaemon::Helper::Process
- Defined in:
- lib/edaemon/helper/process.rb
Class Method Summary collapse
-
.list ⇒ Object
:nocov:.
-
.pids ⇒ Object
:nocov:.
Class Method Details
.list ⇒ Object
:nocov:
6 7 8 |
# File 'lib/edaemon/helper/process.rb', line 6 def list `ps ax`.split("\n") end |
.pids ⇒ Object
: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 |