Sha256: e867bca00983e8fc0bd9f41dd1ed0778cc41645937be9793c64403149b5bb8f7

Contents?: true

Size: 241 Bytes

Versions: 16

Compression:

Stored size: 241 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

16 entries across 16 versions & 1 rubygems

Version Path
dev_commands-0.0.49 lib/internet.rb
dev_commands-0.0.48 lib/internet.rb
dev_commands-0.0.47 lib/internet.rb
dev_commands-0.0.46 lib/internet.rb
dev_commands-0.0.45 lib/internet.rb
dev_commands-0.0.44 lib/internet.rb
dev_commands-0.0.43 lib/internet.rb
dev_commands-0.0.42 lib/internet.rb
dev_commands-0.0.41 lib/internet.rb
dev_commands-0.0.40 lib/internet.rb
dev_commands-0.0.39 lib/internet.rb
dev_commands-0.0.38 lib/internet.rb
dev_commands-0.0.37 lib/internet.rb
dev_commands-0.0.36 lib/internet.rb
dev_commands-0.0.35 lib/internet.rb
dev_commands-0.0.34 lib/internet.rb