aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/definition.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-06-09 21:10:12 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-06-15 07:01:23 +0900
commit21238f38a8eb881d403e47395781c2cc9eafbd9a (patch)
tree6065e6437ada219c3f8cdc81f455ab326989f79f /lib/bundler/definition.rb
parent4f1b1817a8f5f51f9e3687dac465dabfb112883b (diff)
downloadruby-21238f38a8eb881d403e47395781c2cc9eafbd9a.tar.gz
[rubygems/rubygems] Extract `Definition#no_resolved_needed?`
https://github.com/rubygems/rubygems/commit/1ff8626571
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r--lib/bundler/definition.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 39b7d086f0..7bcc768b51 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -281,7 +281,7 @@ module Bundler
@resolve ||= if Bundler.frozen_bundle?
Bundler.ui.debug "Frozen, using resolution from the lockfile"
@locked_specs
- elsif !unlocking? && nothing_changed?
+ elsif no_resolve_needed?
if deleted_deps.any?
Bundler.ui.debug "Some dependencies were deleted, using a subset of the resolution from the lockfile"
SpecSet.new(filter_specs(@locked_specs, @dependencies - deleted_deps))
@@ -477,6 +477,10 @@ module Bundler
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@incomplete_lockfile
end
+ def no_resolve_needed?
+ !unlocking? && nothing_changed?
+ end
+
def unlocking?
@unlocking
end