I write a lot of scripts that I run once or infrequently that uses
open-rui. Occasionally I run into a web site that times out or is
unavailable for a period of time. My normal solution is to just rerun
the script manually at a later time and the problem goes away. What I
would like to start doing is rescuing the open() and retrying the open()
after a delay. What would be the most idiomatic way to try opening a url
say n times before giving up? Here is my crude code for trying twice:
I would like a more general approach using ruby idioms where I could
specify the maximum number of attempts and delay before giving up.
Thanks for your help.