File: example_ps.rb

package info (click to toggle)
ruby-sys-proctable 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: ruby: 3,656; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 511 bytes parent folder | download | duplicates (2)
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
}