Class: UWA::Widget::SysHd

Inherits:
Handler
  • Object
show all
Defined in:
lib/uwa_syshd/config.rb,
lib/uwa_syshd/widget.rb

Constant Summary collapse

NAME =
'uwa_syshd'
VERSION =
'0.3'
'Copyright (C) 2007 Florent Solt'
DESC =
'UWA system hard disk usage widget'
AUTHOR =
'Florent Solt'
EMAIL =
'[email protected]'
HOMEPAGE =
'http://gnetvibes.rubyforge.org'
LICENSE =
'BSD'

Instance Method Summary collapse

Constructor Details

#initializeSysHd

Returns a new instance of SysHd.



7
8
9
10
11
# File 'lib/uwa_syshd/widget.rb', line 7

def initialize
	super
	@author = AUTHOR
	@title = 'SysHd'
end

Instance Method Details

#valuesObject



13
14
15
16
17
18
19
20
21
# File 'lib/uwa_syshd/widget.rb', line 13

def values
	@values = `df -h -l -x tmpfs`.split("\n")
	@values.shift
	@values.collect! do |v|
		v = v.split(/\s+/)
		[v[5], v[4][/\d+/].to_i, v[2], v[1]]
	end
	self << JSON.unparse(@values)
end