add who example

This commit is contained in:
Doug MacEachern 2007-09-15 15:54:02 +00:00
parent f51655e4e3
commit c4e5638fdd
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
require 'rbsigar'
def format_time(who)
return Time.at(who.time).strftime("%b %e %H:%M")
end
sigar = Sigar.new
whos = sigar.who_list
whos.each do |who|
puts who.user + "\t" + who.device + "\t" + format_time(who) + who.host
end