mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-12-10 00:03:00 -05:00
bumped rubocop to 0.54
This commit is contained in:
parent
0e0e7b1ead
commit
79c7d72f2a
@ -52,7 +52,10 @@ Lint/RescueException:
|
|||||||
Style/Alias:
|
Style/Alias:
|
||||||
EnforcedStyle: prefer_alias_method
|
EnforcedStyle: prefer_alias_method
|
||||||
|
|
||||||
Style/TrailingCommaInLiteral:
|
Style/TrailingCommaInHashLiteral:
|
||||||
|
EnforcedStyleForMultiline: comma
|
||||||
|
|
||||||
|
Style/TrailingCommaInArrayLiteral:
|
||||||
EnforcedStyleForMultiline: comma
|
EnforcedStyleForMultiline: comma
|
||||||
|
|
||||||
Style/StringLiterals:
|
Style/StringLiterals:
|
||||||
|
|||||||
@ -44,3 +44,6 @@ Style/Documentation:
|
|||||||
|
|
||||||
Naming/AccessorMethodName:
|
Naming/AccessorMethodName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/UncommunicativeMethodParamName:
|
||||||
|
Enabled: false
|
||||||
2
Gemfile
2
Gemfile
@ -7,7 +7,7 @@ gemspec
|
|||||||
|
|
||||||
gem "hanna-nouveau", require: false
|
gem "hanna-nouveau", require: false
|
||||||
gem "rake", "~> 12.3"
|
gem "rake", "~> 12.3"
|
||||||
gem "rubocop", "~> 0.52.1", require: false
|
gem "rubocop", "~> 0.54.0", require: false
|
||||||
gem "simplecov", require: false
|
gem "simplecov", require: false
|
||||||
|
|
||||||
platform :mri do
|
platform :mri do
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# 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::Specification.new do |gem|
|
||||||
gem.authors = ["Tiago Cardoso"]
|
gem.authors = ["Tiago Cardoso"]
|
||||||
|
|||||||
@ -226,7 +226,7 @@ module HTTPX
|
|||||||
|
|
||||||
def emit_error(e)
|
def emit_error(e)
|
||||||
response = ErrorResponse.new(e, 0, @options)
|
response = ErrorResponse.new(e, 0, @options)
|
||||||
@pending.each do |request, _| # rubocop:disable Performance/HashEachMethods
|
@pending.each do |request, _|
|
||||||
emit(:response, request, response)
|
emit(:response, request, response)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,16 +5,16 @@ module HTTPX
|
|||||||
EMPTY = [].freeze # :nodoc:
|
EMPTY = [].freeze # :nodoc:
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def new(h = nil)
|
def new(headers = nil)
|
||||||
return h if h.is_a?(self)
|
return headers if headers.is_a?(self)
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(h = nil)
|
def initialize(headers = nil)
|
||||||
@headers = {}
|
@headers = {}
|
||||||
return unless h
|
return unless headers
|
||||||
h.each do |field, value|
|
headers.each do |field, value|
|
||||||
array_value(value).each do |v|
|
array_value(value).each do |v|
|
||||||
add(downcased(field), v)
|
add(downcased(field), v)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -37,9 +37,9 @@ module HTTPX
|
|||||||
|
|
||||||
module ResponseMethods
|
module ResponseMethods
|
||||||
def cookie_jar
|
def cookie_jar
|
||||||
return @cookies if defined?(@cookies)
|
return @cookie_jar if defined?(@cookie_jar)
|
||||||
return nil unless headers.key?("set-cookie")
|
return nil unless headers.key?("set-cookie")
|
||||||
@cookies ||= begin
|
@cookie_jar ||= begin
|
||||||
jar = HTTP::CookieJar.new
|
jar = HTTP::CookieJar.new
|
||||||
jar.parse(headers["set-cookie"], @request.uri)
|
jar.parse(headers["set-cookie"], @request.uri)
|
||||||
jar
|
jar
|
||||||
|
|||||||
@ -75,7 +75,7 @@ module ProxyHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def parse_http_proxies
|
def parse_http_proxies
|
||||||
@__http__proxies ||= Oga.parse_html(fetch_http_proxies)
|
@parse_http_proxies ||= Oga.parse_html(fetch_http_proxies)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_http_proxies
|
def fetch_http_proxies
|
||||||
@ -83,7 +83,7 @@ module ProxyHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def parse_socks_proxies
|
def parse_socks_proxies
|
||||||
@__socks__proxies ||= Oga.parse_html(fetch_socks_proxies)
|
@parse_socks_proxies ||= Oga.parse_html(fetch_socks_proxies)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch_socks_proxies
|
def fetch_socks_proxies
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user