From: pjb@... (Pascal J. Bourguignon) Date: 2008-03-17T22:49:53+09:00 Subject: Re: Test for Internet Connection Cory Cory writes: > Does anyone know a way to test to see if the computer is connected to > the internet in Ruby? > > I wrote a Ruby program with WWW::Mechanize, but it completely hangs Ruby > when my internet is turned off. Because Ruby does not use system > threading, there is no way to check for a timeout when WWW::Mechanizer > freezes due to not having an internet connection. require 'ping' Ping.pingecho("google.com",10,80) # --> true or false -- __Pascal Bourguignon__