class Application @@applications def initialize @@applications = `/usr/bin/whereis php node mysql vim python ruby java apache2 nginx openssl vsftpd make'.'| /usr/bin/awk '{ split($1, a, ":");if (length($2)==0) print a[1]",not"; else print a[1]","$2;}'` end def parse @@applications = @@applications.split("\n") $return_data = {} $i = 0 @@applications.each do |line| line = line.split(",") $i += 1 $return_data[$i] = { 'application' => line[0], 'status' => line[1] } end $return_data end end