Retry wrapper for Ruby