A module that adds #retryable to your classes, which retries blocks when an exception occurs.
Add this line to your application's Gemfile:
gem 'retryable_block'And then execute:
$ bundle
Or install it yourself as:
$ gem install retryable_block
Include RetryableBlock to your class and use retryable(n=3, sleep_time=nil, exceptions = [StandardError], &block)
n=3 means 3 retries
sleep_time number of seconds for sleep between retries, if nil retry will be call immediately.
exceptions list of exceptions for retries, you can pass list of exceptions classes, as default value it will use rescue StandardError
- Fork it ( https://github.com/[my-github-username]/retryable_block/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request


