diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-02-26 19:43:50 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-02-26 22:04:08 +0000 |
commit | 81dded1044d0d045af10c916eaed9429a8509ae3 (patch) | |
tree | 56d081e25092be1bf648962699bf4970a9b09036 | |
parent | c3427265687d008612179410009868b5ec10b116 (diff) |
[rubygems/rubygems] Skip to load vendored libraries if it's already loaded
https://github.com/rubygems/rubygems/commit/3f5093fac9
-rw-r--r-- | lib/rubygems/vendored_net_http.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/vendored_timeout.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/rubygems/vendored_net_http.rb b/lib/rubygems/vendored_net_http.rb index 0c0f8d446d..a84c52a947 100644 --- a/lib/rubygems/vendored_net_http.rb +++ b/lib/rubygems/vendored_net_http.rb @@ -1,3 +1,5 @@ # frozen_string_literal: true -require_relative "vendor/net-http/lib/net/http" +# Ruby 3.3 and RubyGems 3.5 is already load Gem::Timeout from lib/rubygems/net/http.rb +# We should avoid to load it again +require_relative "vendor/net-http/lib/net/http" unless defined?(Gem::Net::HTTP) diff --git a/lib/rubygems/vendored_timeout.rb b/lib/rubygems/vendored_timeout.rb index 6b8e1c7aa8..45541928e6 100644 --- a/lib/rubygems/vendored_timeout.rb +++ b/lib/rubygems/vendored_timeout.rb @@ -1,3 +1,5 @@ # frozen_string_literal: true -require_relative "vendor/timeout/lib/timeout" +# Ruby 3.3 and RubyGems 3.5 is already load Gem::Timeout from lib/rubygems/timeout.rb +# We should avoid to load it again +require_relative "vendor/timeout/lib/timeout" unless defined?(Gem::Timeout) |