1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#######################################################################
# example_ps.rb
#
# Generic test program that demonstrates the use of ProcTable.ps. You
# can run this via the 'rake example' task.
#
# Modify as you see fit
#######################################################################
require 'sys/proctable'
include Sys
puts "VERSION: " + ProcTable::VERSION
sleep 2
ProcTable.ps{ |s|
ProcTable.fields.each{ |field|
puts "#{field}: " + s.send(field).to_s
}
puts '=' * 30
}
|