Skip to content

Commit

Permalink
[rubygems/rubygems] Skip to load vendored libraries if it's already l…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt authored and matzbot committed Feb 26, 2024
1 parent c342726 commit 81dded1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion 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)
4 changes: 3 additions & 1 deletion 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)

0 comments on commit 81dded1

Please sign in to comment.