Module: RailsPwnage::Base
- Defined in:
- lib/zergling/process.rb
Instance Method Summary collapse
-
#process_info(pid = nil) ⇒ Object
returns information about a process.
Instance Method Details
#process_info(pid = nil) ⇒ Object
returns information about a process
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/zergling/process.rb', line 35 def process_info(pid = nil) info = Hash.new Sys::ProcTable.ps.each do |process| item = { :cmdline => process.cmdline, :pid => process.pid.to_s } if pid.nil? info[process.pid.to_s] = item else return item if item.pid.to_s == pid.to_s end end if pid.nil? return info else return nil end end |