A colleague of mine has been using Watir and needed to retry evaluating an expression a number of times until it works (I'm sure IE::wait should be taking care of things, but apparently not in this case). What he came up with was fully functional, but even to my relatively inexperienced eye didn't look Ruby-esque. So this is what I came up with instead:

module PdbMisc
# ttata = "Try, try and try again!"
# Example usages below
def ttata(timeout=3, interval=1, logger=nil)
raise "Block expected" unless block_given?
while true
begin
return yield
rescue
logger.call "ttata: failed - #{$!}" if logger
timeout -= interval
raise if timeout <= 0
sleep interval
end
end
end
end

Now you've got to love a language that makes this sort of thing so easy... See it in all it's syntax-highlighted glory over in the coding samples section of my family website, along with some example calls as well. Enjoy!