Skip to content

Commit 81dded1

Browse files
hsbtmatzbot
authored andcommitted
[rubygems/rubygems] Skip to load vendored libraries if it's already loaded
rubygems/rubygems@3f5093fac9
1 parent c342726 commit 81dded1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/rubygems/vendored_net_http.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# frozen_string_literal: true
22

3-
require_relative "vendor/net-http/lib/net/http"
3+
# Ruby 3.3 and RubyGems 3.5 is already load Gem::Timeout from lib/rubygems/net/http.rb
4+
# We should avoid to load it again
5+
require_relative "vendor/net-http/lib/net/http" unless defined?(Gem::Net::HTTP)

lib/rubygems/vendored_timeout.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# frozen_string_literal: true
22

3-
require_relative "vendor/timeout/lib/timeout"
3+
# Ruby 3.3 and RubyGems 3.5 is already load Gem::Timeout from lib/rubygems/timeout.rb
4+
# We should avoid to load it again
5+
require_relative "vendor/timeout/lib/timeout" unless defined?(Gem::Timeout)

0 commit comments

Comments
 (0)