attempt_to

AttemptTo calls a code block and re-tries it if it throws an exception. Otherwise exits


Install
gem install attempt_to -v 0.4.1

Documentation

attempt_to

Small gem for attempting to do something and returning errors if it fails.

Usage:

Try to connect 3 times to the network, otherwise exit.

attempt_to('connect to the network', 3) { TCPSocket.new("some.very.weird.domain.name", 9342) }