Skip to content

Commit

Permalink
Lets move away from system dependencies, and start moving towards say,
Browse files Browse the repository at this point in the history
the stdlib.
  • Loading branch information
jrgifford committed Jun 16, 2012
1 parent 3a9a758 commit 2124b9d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion main.rb
@@ -1,5 +1,14 @@
require 'green_shoes'
require 'facter'
require 'net/http'

class WhatIsMy
def self.external_ip
url = "http://icanhazip.com/"
resp = Net::HTTP.get_response(URI.parse(url))
resp.body
end
end

Shoes.app( :title => "System Stats", :width => 350, :height => 250 ) do
background linen
Expand All @@ -8,5 +17,5 @@
para "Your IP Address is: " + Facter.ipaddress
para "You are running: " + Facter.lsbdistdescription
para "Your uptime is: " + Facter.uptime
para "Your external IP address is: " + `curl http://icanhazip.com/`
para "Your external IP address is: " + WhatIsMy::external_ip
end

0 comments on commit 2124b9d

Please sign in to comment.