bumped rubocop to 0.54

This commit is contained in:
HoneyryderChuck 2018-03-26 17:16:41 +01:00
parent 0e0e7b1ead
commit 79c7d72f2a
8 changed files with 19 additions and 13 deletions

View File

@ -52,7 +52,10 @@ Lint/RescueException:
Style/Alias:
EnforcedStyle: prefer_alias_method
Style/TrailingCommaInLiteral:
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/StringLiterals:

View File

@ -44,3 +44,6 @@ Style/Documentation:
Naming/AccessorMethodName:
Enabled: false
Naming/UncommunicativeMethodParamName:
Enabled: false

View File

@ -7,7 +7,7 @@ gemspec
gem "hanna-nouveau", require: false
gem "rake", "~> 12.3"
gem "rubocop", "~> 0.52.1", require: false
gem "rubocop", "~> 0.54.0", require: false
gem "simplecov", require: false
platform :mri do

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
require File.expand_path("../lib/httpx/version", __FILE__)
require File.expand_path("lib/httpx/version", __dir__)
Gem::Specification.new do |gem|
gem.authors = ["Tiago Cardoso"]

View File

@ -226,7 +226,7 @@ module HTTPX
def emit_error(e)
response = ErrorResponse.new(e, 0, @options)
@pending.each do |request, _| # rubocop:disable Performance/HashEachMethods
@pending.each do |request, _|
emit(:response, request, response)
end
end

View File

@ -5,16 +5,16 @@ module HTTPX
EMPTY = [].freeze # :nodoc:
class << self
def new(h = nil)
return h if h.is_a?(self)
def new(headers = nil)
return headers if headers.is_a?(self)
super
end
end
def initialize(h = nil)
def initialize(headers = nil)
@headers = {}
return unless h
h.each do |field, value|
return unless headers
headers.each do |field, value|
array_value(value).each do |v|
add(downcased(field), v)
end

View File

@ -37,9 +37,9 @@ module HTTPX
module ResponseMethods
def cookie_jar
return @cookies if defined?(@cookies)
return @cookie_jar if defined?(@cookie_jar)
return nil unless headers.key?("set-cookie")
@cookies ||= begin
@cookie_jar ||= begin
jar = HTTP::CookieJar.new
jar.parse(headers["set-cookie"], @request.uri)
jar

View File

@ -75,7 +75,7 @@ module ProxyHelper
end
def parse_http_proxies
@__http__proxies ||= Oga.parse_html(fetch_http_proxies)
@parse_http_proxies ||= Oga.parse_html(fetch_http_proxies)
end
def fetch_http_proxies
@ -83,7 +83,7 @@ module ProxyHelper
end
def parse_socks_proxies
@__socks__proxies ||= Oga.parse_html(fetch_socks_proxies)
@parse_socks_proxies ||= Oga.parse_html(fetch_socks_proxies)
end
def fetch_socks_proxies