diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-06-20 12:04:04 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-06-20 13:35:13 +0900 |
commit | 1edbaa850f6907c9b4bbaa083ef13a578f251da1 (patch) | |
tree | b722898a4854a20dd4d94f92442a2b2468fc1d91 /lib/bundler/source | |
parent | 44ad176fc250553950ee7b54071d14aedc4183a5 (diff) |
Merge rubygems/rubygems HEAD
Pick from https://github.com/rubygems/rubygems/commit/880dd95996c93adc1e032399816931b243c5fe17
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7961
Diffstat (limited to 'lib/bundler/source')
-rw-r--r-- | lib/bundler/source/metadata.rb | 30 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 1 |
2 files changed, 15 insertions, 16 deletions
diff --git a/lib/bundler/source/metadata.rb b/lib/bundler/source/metadata.rb index 593da6d1a7..524db9c204 100644 --- a/lib/bundler/source/metadata.rb +++ b/lib/bundler/source/metadata.rb @@ -10,22 +10,22 @@ module Bundler s.required_rubygems_version = Gem::Requirement.default end - idx << Gem::Specification.new do |s| - s.name = "bundler" - s.version = VERSION - s.license = "MIT" - s.platform = Gem::Platform::RUBY - s.authors = ["bundler team"] - s.bindir = "exe" - s.homepage = "https://bundler.io" - s.summary = "The best way to manage your application's dependencies" - s.executables = %w[bundle] - # can't point to the actual gemspec or else the require paths will be wrong - s.loaded_from = __dir__ - end - - if local_spec = Bundler.rubygems.find_bundler(VERSION) + if local_spec = Gem.loaded_specs["bundler"] idx << local_spec + else + idx << Gem::Specification.new do |s| + s.name = "bundler" + s.version = VERSION + s.license = "MIT" + s.platform = Gem::Platform::RUBY + s.authors = ["bundler team"] + s.bindir = "exe" + s.homepage = "https://bundler.io" + s.summary = "The best way to manage your application's dependencies" + s.executables = %w[bundle] + # can't point to the actual gemspec or else the require paths will be wrong + s.loaded_from = __dir__ + end end idx.each {|s| s.source = self } diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index af82ca6b6c..af55ba0f2c 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -381,7 +381,6 @@ module Bundler idx = @allow_local ? installed_specs.dup : Index.new Dir["#{cache_path}/*.gem"].each do |gemfile| - next if /^bundler\-[\d\.]+?\.gem/.match?(gemfile) s ||= Bundler.rubygems.spec_from_gem(gemfile) s.source = self idx << s |