diff options
| author | Samuel Giddins <segiddins@segiddins.me> | 2024-09-19 15:10:40 -0700 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-09-20 14:26:13 +0000 |
| commit | 43e3416b700e421ffdff3a9c534e1de620bb7ad6 (patch) | |
| tree | 5d36bf7eaf46118b2417182ae401f6e3e669046b /lib | |
| parent | 7836626f92be77c02da633077863f84435acee5d (diff) | |
[rubygems/rubygems] Unconditionally set installed_by_version
It has been supported since RubyGems 2.2.0 via https://github.com/rubygems/rubygems/commit/4525e45a4d45
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
https://github.com/rubygems/rubygems/commit/bf39c583e8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bundler/plugin/api/source.rb | 2 | ||||
| -rw-r--r-- | lib/bundler/rubygems_integration.rb | 5 | ||||
| -rw-r--r-- | lib/bundler/source/git.rb | 2 | ||||
| -rw-r--r-- | lib/bundler/source/path.rb | 2 | ||||
| -rw-r--r-- | lib/rubygems/specification.rb | 2 |
5 files changed, 4 insertions, 9 deletions
diff --git a/lib/bundler/plugin/api/source.rb b/lib/bundler/plugin/api/source.rb index f91b263875..690f379389 100644 --- a/lib/bundler/plugin/api/source.rb +++ b/lib/bundler/plugin/api/source.rb @@ -131,7 +131,7 @@ module Bundler Bundler::Index.build do |index| files.each do |file| next unless spec = Bundler.load_gemspec(file) - Bundler.rubygems.set_installed_by_version(spec) + spec.installed_by_version = Gem::VERSION spec.source = self Bundler.rubygems.validate(spec) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 72dead88f2..b98d3b7b8c 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -61,11 +61,6 @@ module Bundler nil end - def set_installed_by_version(spec, installed_by_version = Gem::VERSION) - return unless spec.respond_to?(:installed_by_version=) - spec.installed_by_version = Gem::Version.create(installed_by_version) - end - def spec_missing_extensions?(spec, default = true) return spec.missing_extensions? if spec.respond_to?(:missing_extensions?) diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 2a327e5fb6..c52ce04638 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -299,7 +299,7 @@ module Bundler # The gemspecs we cache should already be evaluated. spec = Bundler.load_gemspec(spec_path) next unless spec - Bundler.rubygems.set_installed_by_version(spec) + spec.installed_by_version = Gem::VERSION Bundler.rubygems.validate(spec) File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) } end diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 754eaa39c4..6a99f8e977 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -148,7 +148,7 @@ module Bundler def load_gemspec(file) return unless spec = Bundler.load_gemspec(file) - Bundler.rubygems.set_installed_by_version(spec) + spec.installed_by_version = Gem::VERSION spec end diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 38986d5633..5735038ad3 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -2472,7 +2472,7 @@ class Gem::Specification < Gem::BasicSpecification if @installed_by_version result << nil - result << " s.installed_by_version = #{ruby_code Gem::VERSION} if s.respond_to? :installed_by_version" + result << " s.installed_by_version = #{ruby_code Gem::VERSION}" end unless dependencies.empty? |
