blob: 8ff2ccd1fe877d03461b0408f7ade70422ed3a87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# frozen_string_literal: true
# This defined? guard can be removed once RubyGems 3.4 support is dropped.
#
# Bundler specs load this code from `spec/support/vendored_net_http.rb` to avoid
# activating the Bundler gem too early. Without this guard, we get redefinition
# warnings once Bundler is actually activated and
# `lib/bundler/vendored_net_http.rb` is required. This is not an issue in
# RubyGems versions including `rubygems/vendored_net_http` since `require` takes
# care of avoiding the double load.
#
unless defined?(Gem::Net)
begin
require "rubygems/vendored_net_http"
rescue LoadError
begin
require "rubygems/net/http"
rescue LoadError
require "net/http"
Gem::Net = Net
end
end
end
|