summaryrefslogtreecommitdiff
path: root/lib/rubygems/request
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-08-09 11:16:07 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-08-09 12:05:19 +0900
commit44264b4fee1e208e759710c39271186ff9856b40 (patch)
tree939a9810293c86553e7b600bce9fb426776f6000 /lib/rubygems/request
parentf8936b3341376948112e31f9e9b0cb3ad6e91e7c (diff)
Merge rubygems/bundler HEAD.
Pick from https://github.com/rubygems/rubygems/commit/dfbb5a38114640e0d8d616861607f3de73ee0199
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6224
Diffstat (limited to 'lib/rubygems/request')
-rw-r--r--lib/rubygems/request/connection_pools.rb4
-rw-r--r--lib/rubygems/request/http_pool.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/rubygems/request/connection_pools.rb b/lib/rubygems/request/connection_pools.rb
index a283267674..44280489fb 100644
--- a/lib/rubygems/request/connection_pools.rb
+++ b/lib/rubygems/request/connection_pools.rb
@@ -39,7 +39,7 @@ class Gem::Request::ConnectionPools # :nodoc:
def get_no_proxy_from_env
env_no_proxy = ENV["no_proxy"] || ENV["NO_PROXY"]
- return [] if env_no_proxy.nil? or env_no_proxy.empty?
+ return [] if env_no_proxy.nil? || env_no_proxy.empty?
env_no_proxy.split(/\s*,\s*/)
end
@@ -78,7 +78,7 @@ class Gem::Request::ConnectionPools # :nodoc:
no_proxy = get_no_proxy_from_env
- if proxy_uri and not no_proxy?(hostname, no_proxy)
+ if proxy_uri && !no_proxy?(hostname, no_proxy)
proxy_hostname = proxy_uri.respond_to?(:hostname) ? proxy_uri.hostname : proxy_uri.host
net_http_args + [
proxy_hostname,
diff --git a/lib/rubygems/request/http_pool.rb b/lib/rubygems/request/http_pool.rb
index f028516db8..7b309eedd3 100644
--- a/lib/rubygems/request/http_pool.rb
+++ b/lib/rubygems/request/http_pool.rb
@@ -26,7 +26,7 @@ class Gem::Request::HTTPPool # :nodoc:
def close_all
until @queue.empty?
- if connection = @queue.pop(true) and connection.started?
+ if (connection = @queue.pop(true)) && connection.started?
connection.finish
end
end