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) }
AttemptTo calls a code block and re-tries it if it throws an exception. Otherwise exits
Homepage Rubygems Ruby Documentation Download
gem install attempt_to -v 0.4.1
Small gem for attempting to do something and returning errors if it fails.
Usage:
attempt_to('connect to the network', 3) { TCPSocket.new("some.very.weird.domain.name", 9342) }