Class: Inspector

Inherits:
Object show all
Defined in:
lib/commands/process/inspector.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pid_path, pattern) ⇒ Inspector

Returns a new instance of Inspector.



16
17
18
# File 'lib/commands/process/inspector.rb', line 16

def initialize(pid_path, pattern)
  @pid_path, @pattern = pid_path, pattern
end

Class Method Details

.inspect(pid_path, pattern) ⇒ Object



12
13
14
# File 'lib/commands/process/inspector.rb', line 12

def self.inspect(pid_path, pattern)
  new(pid_path, pattern).inspect
end

Instance Method Details

#inspectObject



20
21
22
23
24
25
# File 'lib/commands/process/inspector.rb', line 20

def inspect
  header = `#{OPTIONS[:ps] % 1}`.split("\n")[0] + "\n"
  lines  = pids.collect { |pid| `#{OPTIONS[:ps] % pid}`.split("\n")[1] }
  
  puts(header + lines.join("\n"))
end