Skip to content

Instantly share code, notes, and snippets.

View glenngillen's full-sized avatar

Glenn Gillen glenngillen

View GitHub Profile
@glenngillen
glenngillen / retry_upto.rb
Created October 7, 2011 07:59 — forked from raul/retry_upto.rb
retry_upto.rb
# Ruby `retry` with steroids:
#
# - retry up to 5 times without waiting between them and retrying after any exception
#
# retry_upto(5) do ... end
#
# - retry up to 5 times, waiting 2 seconds between retries and retrying after any exception
#
# retry_upto(5, :wait => 2) do ... end
#