diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-12-21 14:50:44 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-12-21 15:27:05 +0900 |
commit | 69dc2ea46538f47ff5edda3bb16863034bd19069 (patch) | |
tree | a4c545640fbdf31ab90f02a7def173840944806b /lib/bundler/rubygems_integration.rb | |
parent | ad450c9fe51c51626dd07f6e766f47d839cae3ba (diff) |
Merge RubyGems-3.3.0 and Bundler-2.3.0
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5317
Diffstat (limited to 'lib/bundler/rubygems_integration.rb')
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index effb88c1cd..785f7fa360 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -12,25 +12,21 @@ module Bundler EXT_LOCK = Monitor.new end - def self.version - @version ||= Gem::Version.new(Gem::VERSION) - end - - def self.provides?(req_str) - Gem::Requirement.new(req_str).satisfied_by?(version) - end - def initialize @replaced_methods = {} backport_ext_builder_monitor end def version - self.class.version + @version ||= Gem.rubygems_version end def provides?(req_str) - self.class.provides?(req_str) + Gem::Requirement.new(req_str).satisfied_by?(version) + end + + def supports_bundler_trampolining? + provides?(">= 3.3.0.a") end def build_args @@ -142,19 +138,6 @@ module Bundler end end - def sources=(val) - # Gem.configuration creates a new Gem::ConfigFile, which by default will read ~/.gemrc - # If that file exists, its settings (including sources) will overwrite the values we - # are about to set here. In order to avoid that, we force memoizing the config file now. - configuration - - Gem.sources = val - end - - def sources - Gem.sources - end - def gem_dir Gem.dir end @@ -588,6 +571,10 @@ module Bundler end end + def find_bundler(version) + find_name("bundler").find {|s| s.version.to_s == version } + end + def find_name(name) Gem::Specification.stubs_for(name).map(&:to_spec) end |