summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2025-02-03 18:32:40 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-02-13 09:37:50 +0900
commit5adbad731b3354e2cdf1befa0ec719f3609678dc (patch)
treea5e55767bb6229533cdc4831bc3185523fbd0e44
parent06e3943c38b83d6784d9d9be6d5f389a862a3f7d (diff)
[rubygems/rubygems] Move logic to materialize gems for cache to a new method
And make the current `materialize_strictly` private. https://github.com/rubygems/rubygems/commit/3fc2129147
-rw-r--r--lib/bundler/lazy_specification.rb14
-rw-r--r--lib/bundler/spec_set.rb3
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 9511f26d15..479736094f 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -121,10 +121,10 @@ module Bundler
out
end
- def materialize_strictly
- materialize(self) do |matching_specs|
- choose_compatible(matching_specs)
- end
+ def materialize_for_cache
+ source.remote!
+
+ materialize_strictly
end
def materialized_for_installation
@@ -185,6 +185,12 @@ module Bundler
(most_specific_locked_platform != generic_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
end
+ def materialize_strictly
+ materialize(self) do |matching_specs|
+ choose_compatible(matching_specs)
+ end
+ end
+
def materialize(query)
matching_specs = source.specs.search(query)
return self if matching_specs.empty?
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index 8dfd9917ec..599b5cf439 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -117,8 +117,7 @@ module Bundler
def materialized_for_all_platforms
@specs.map do |s|
next s unless s.is_a?(LazySpecification)
- s.source.remote!
- spec = s.materialize_strictly
+ spec = s.materialize_for_cache
raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
spec
end