diff options
author | Ellen Marie Dash <the@smallest.dog> | 2022-03-31 23:44:31 +0000 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-06-01 19:01:18 +0900 |
commit | 1177665e6224f8491db82997c8774e9485564e41 (patch) | |
tree | 6459500e449bf862d3d34c33531a4e22c747fd1a /lib | |
parent | 0a6b9924bd1b45bd8ad29b1eb3c8a65835f5864d (diff) | |
download | ruby-1177665e6224f8491db82997c8774e9485564e41.tar.gz |
[rubygems/rubygems] Fix `bundle remove` by invalidating cached `Bundle.defintion`.
Prior to this commit, `bundle add GEM_NAME` updated the lockfile,
but `bundle remove GEM_NAME` left GEM_NAME in the lockfile.
By invalidating the cached `Bundle.definition`, the existing code
handles that without a problem.
https://github.com/rubygems/rubygems/commit/aa0794d6a9
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/injector.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb index 42f837a919..f6550abe88 100644 --- a/lib/bundler/injector.rb +++ b/lib/bundler/injector.rb @@ -72,6 +72,10 @@ module Bundler deps.each {|dep| Bundler.ui.confirm "#{SharedHelpers.pretty_dependency(dep, false)} was removed." } end + + # Invalidate the cached Bundler.definition. + # This prevents e.g. `bundle remove ...` from using outdated information. + Bundler.reset_paths! end private |