I have taken the liberty of heavily modifying timeout.rb.  Why?
This is because I felt it hehaved like two different functions,
one giving a true/false indication of timeout, and one giving the
result of the block or an exception, but they were connected, so
you didn't now which flavour you would get till you had invoked
timeout(sec).  I have separated out these two ways of looking at
a timeout, and have added unit tests. You can still get the old
behaviour (default).  You can see the file at

http://www.eng.cse.dmu.ac.uk/~hgs/ruby/timeout.rb

with a link off here.
http://www.eng.cse.dmu.ac.uk/~hgs/ruby/

I hope this is useful.  

	Hugh