ruby-changes:57550
From: David <ko1@a...>
Date: Thu, 5 Sep 2019 19:40:01 +0900 (JST)
Subject: [ruby-changes:57550] d219be4a1c (master): [rubygems/rubygems] Move empty check earlier
https://git.ruby-lang.org/ruby.git/commit/?id=d219be4a1c From d219be4a1c237356670ebafd415e983433362e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Wed, 21 Aug 2019 20:05:24 +0200 Subject: [rubygems/rubygems] Move empty check earlier https://github.com/rubygems/rubygems/commit/fc224e9717 diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb index bbca221..46d9282 100644 --- a/lib/rubygems/uninstaller.rb +++ b/lib/rubygems/uninstaller.rb @@ -88,6 +88,10 @@ class Gem::Uninstaller https://github.com/ruby/ruby/blob/trunk/lib/rubygems/uninstaller.rb#L88 list << spec end + if list.empty? + raise Gem::InstallError, "gem #{@gem.inspect} is not installed" + end + default_specs, list = list.partition do |spec| spec.default_gem? end @@ -101,9 +105,7 @@ class Gem::Uninstaller https://github.com/ruby/ruby/blob/trunk/lib/rubygems/uninstaller.rb#L105 if list.empty? if other_repo_specs.empty? - if default_specs.empty? - raise Gem::InstallError, "gem #{@gem.inspect} is not installed" - else + if default_specs.any? message = "gem #{@gem.inspect} cannot be uninstalled " + "because it is a default gem" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/