some rubocop updates

This commit is contained in:
Andrew Waage 2016-10-20 11:49:02 -07:00
parent 15d0b63b45
commit 134d10bab0
3 changed files with 9 additions and 10 deletions

View File

@ -30,5 +30,4 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency("faraday-http-cache")
spec.add_runtime_dependency("activesupport")
spec.add_runtime_dependency("retriable", ["~> 2.1"])
end

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
require 'retriable'
require "retriable"
module GitHubChangelogGenerator
# A Fetcher responsible for all requests to GitHub and all basic manipulation with related data
# (such as filtering, validating, e.t.c)
@ -297,12 +297,12 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
# Exponential backoff
def retry_options
{
:on => [Octokit::Forbidden],
:tries => MAX_FORBIDDEN_RETRIES,
:base_interval => sleep_base_interval,
:multiplier => 1.0,
:rand_factor => 0.0,
:on_retry => retry_callback
on: [Octokit::Forbidden],
tries: MAX_FORBIDDEN_RETRIES,
base_interval: sleep_base_interval,
multiplier: 1.0,
rand_factor: 0.0,
on_retry: retry_callback
}
end
@ -311,7 +311,7 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
end
def retry_callback
Proc.new do |exception, try, elapsed_time, next_interval|
proc do |exception, try, elapsed_time, next_interval|
Helper.log.warn("RETRY - #{exception.class}: '#{exception.message}'")
Helper.log.warn("#{try} tries in #{elapsed_time} seconds and #{next_interval} seconds until the next try")
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG

View File

@ -42,7 +42,7 @@ module GitHubChangelogGenerator
# setup parsing options
def self.setup_parser(options)
parser = OptionParser.new do |opts|
parser = OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength
opts.banner = "Usage: github_changelog_generator [options]"
opts.on("-u", "--user [USER]", "Username of the owner of target GitHub repo") do |last|
options[:user] = last