summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2024-07-23 19:22:01 +0200
committergit <[email protected]>2024-07-23 19:43:26 +0000
commite7610582ad8fd05655221b183257ed358c903ac8 (patch)
treebb2e5a65ee32ae103816a098bd323da6a38facd3 /lib
parent481c83453b447f2645a146bc5c45199659c71860 (diff)
[rubygems/rubygems] Fix `bundle exec gem uninstall`
* `bundle exec` assigns `Gem::Specification.all` to the set of specs known to Bundler (a `Bundler::SpecSet`). * `gem uninstall` recently started calling `#delete` on the set of specs stored in `Gem::Specification#all`. This, in RubyGems, is just an array of specs, so has a `#delete` method that receives a single element. * However, at some point I added a `SpecSet#delete` method that takes an array of specs, breaking the "Array-like" contract and making `gem uninstall` break when run in a `bundle exec` context. The fix is to make `Bundler::SpecSet#delete` handle being given a single spec. https://github.com/rubygems/rubygems/commit/e3acb7b01d
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/spec_set.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index 5f513f3f22..bdf140e724 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -94,7 +94,7 @@ module Bundler
end
def delete(specs)
- specs.each {|spec| @specs.delete(spec) }
+ Array(specs).each {|spec| @specs.delete(spec) }
reset!
end