mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-08-10 00:01:27 -04:00
bumped rubocop to 0.54
This commit is contained in:
parent
0e0e7b1ead
commit
79c7d72f2a
@ -52,7 +52,10 @@ Lint/RescueException:
|
||||
Style/Alias:
|
||||
EnforcedStyle: prefer_alias_method
|
||||
|
||||
Style/TrailingCommaInLiteral:
|
||||
Style/TrailingCommaInHashLiteral:
|
||||
EnforcedStyleForMultiline: comma
|
||||
|
||||
Style/TrailingCommaInArrayLiteral:
|
||||
EnforcedStyleForMultiline: comma
|
||||
|
||||
Style/StringLiterals:
|
||||
|
@ -44,3 +44,6 @@ Style/Documentation:
|
||||
|
||||
Naming/AccessorMethodName:
|
||||
Enabled: false
|
||||
|
||||
Naming/UncommunicativeMethodParamName:
|
||||
Enabled: false
|
2
Gemfile
2
Gemfile
@ -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
|
||||
|
@ -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"]
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user