General purpose class for retrying code that may fail
# File lib/bundler/retry.rb, line 11 def initialize(name, exceptions = nil, attempts = nil) @name = name attempts ||= default_attempts @exceptions = Array(exceptions) || [] @total_runs = attempts.next # will run once, then upto attempts.times end
# File lib/bundler/retry.rb, line 23 def attempt(&block) @current_run = 0 @failed = false @error = nil while keep_trying? do run(&block) end @result end
Generated with the Darkfish Rdoc Generator 2.