General purpose class for retrying code that may fail
# File bundler/retry.rb, line 9
def default_attempts
default_retries + 1
end
# File bundler/retry.rb, line 14
def default_retries
Bundler.settings[:retry]
end
# File bundler/retry.rb, line 19
def initialize(name, exceptions = nil, retries = self.class.default_retries)
@name = name
@retries = retries
@exceptions = Array(exceptions) || []
@total_runs = @retries + 1 # will run once, then upto attempts.times
end