lib/ps.rb in ps-0.0.5 vs lib/ps.rb in ps-0.0.6
- old
+ new
@@ -62,16 +62,17 @@
end
require 'ps/command'
require 'ps/process'
require 'ps/process_list'
+require 'ps/process_list_printer'
def PS *args
case args[0]
when Regexp
opts = args[1] || {}
procs = PS.all(opts)
- procs = procs.command(args[0])
+ procs = procs.select {|proc| proc.command =~ args[0]}
procs = procs.select {|proc| proc.pid != Process.pid} unless opts[:include_self]
procs
when Integer
PS.pid(*args).first
when Hash