Stephen Lead wrote:
> require 'timeout'
> for i in 1..1000
>   status = Timeout::timeout(60) {
>     b = Firefox.new
>     b.goto "some site"
>     #1. perform some processing, which should take less than 60 seconds
>     #2. if the process was successful, write the result to a text file
>     #3. if it took too long, abort this iteration, and continue with
> "next i"
>     b.close
>   }
> end

Hi,

You have to rescue the Timeout::Error.
------------------------------------
require "timeout"
for i in 1..1000
  begin
    status = Timeout.timeout(60) do
      #Do whatever you want...
    end
  rescue Timeout::Error
    #Continue with whatever you want...
  end
end
-------------------------------------

Marvin
-- 
Posted via http://www.ruby-forum.com/.