summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/update_command.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-02-02 16:57:34 +0900
committerGitHub <noreply@github.com>2022-02-02 16:57:34 +0900
commit6794f8cf928ab8c009b301ec49a5a81e97e6eb2f (patch)
tree63f83daf2d1d2f57d6aaee9efa01e1c91ee8b021 /lib/rubygems/commands/update_command.rb
parent69463805f0722d90a2049f43e852539b4532bf2e (diff)
Merge pull request #5482 from hsbt/rubygems-3-3-bundler-2-3
Merge RubyGems 3.3.x and Bundler 2.3.x
Diffstat (limited to 'lib/rubygems/commands/update_command.rb')
-rw-r--r--lib/rubygems/commands/update_command.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index 513351d303..42d6f6046b 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -233,10 +233,10 @@ command to remove old versions.
up_ver = gems_to_update.first.version
target = if update_latest
- up_ver
- else
- version
- end
+ up_ver
+ else
+ version
+ end
return target, requirement
end
@@ -286,10 +286,11 @@ command to remove old versions.
check_oldest_rubygems version
- update_gem 'rubygems-update', version
-
installed_gems = Gem::Specification.find_all_by_name 'rubygems-update', requirement
- version = installed_gems.first.version
+ installed_gems = update_gem('rubygems-update', version) if installed_gems.empty? || installed_gems.first.version != version
+ return if installed_gems.empty?
+
+ version = installed_gems.first.version
install_rubygems version
end
@@ -335,7 +336,9 @@ command to remove old versions.
#
def oldest_supported_version
@oldest_supported_version ||=
- if Gem.ruby_version > Gem::Version.new("3.0.a")
+ if Gem.ruby_version > Gem::Version.new("3.1.a")
+ Gem::Version.new("3.3.3")
+ elsif Gem.ruby_version > Gem::Version.new("3.0.a")
Gem::Version.new("3.2.3")
elsif Gem.ruby_version > Gem::Version.new("2.7.a")
Gem::Version.new("3.1.2")