Sha256: 77bacf8311b2ae5514677bde07394930dd485f6e1a1503e32d4f0cf39847a160
Contents?: true
Size: 525 Bytes
Versions: 251
Compression:
Stored size: 525 Bytes
Contents
puts __FILE__ if defined?(DEBUG) require 'open-uri' require 'timeout' class Internet @@available=true def self.available? return @@available if !@@available.nil? begin index=open('http://www.google.com').read if index.include?('<Title>Google') @@available = true else puts "open('http://www.google.com') returned false" end rescue Exception => e puts "open('http://www.google.com') raised an exception: #{e.to_s}" @@available = false end @@available end end
Version data entries
251 entries across 251 versions & 1 rubygems