Sha256: 1f8ae6f55a3082a8c15f880204be6becaa9dc0b03766a9a98e3ff7366cdffe4b

Contents?: true

Size: 257 Bytes

Versions: 12

Compression:

Stored size: 257 Bytes

Contents

require 'open-uri'

class Internet

	@@available=nil

	def self.available?
		return @@available if !@@available.nil?

		begin
			@@available = true if open('http://www.google.com')
		rescue
			@@available = false
		end
		@@available
	end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dev_commands-0.0.53 lib/internet.rb
dev_commands-0.0.52 lib/internet.rb
dev_commands-0.0.51 lib/internet.rb
dev_commands-0.0.50 lib/internet.rb
dev_commands-0.0.33 lib/internet.rb
dev_commands-0.0.32 lib/internet.rb
dev_commands-0.0.31 lib/internet.rb
dev_commands-0.0.30 lib/internet.rb
dev_commands-0.0.29 lib/internet.rb
dev_commands-0.0.28 lib/internet.rb
dev_commands-0.0.27 lib/internet.rb
dev_commands-0.0.26 lib/internet.rb