From 5adbad731b3354e2cdf1befa0ec719f3609678dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 3 Feb 2025 18:32:40 +0100 Subject: [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 --- lib/bundler/lazy_specification.rb | 14 ++++++++++---- lib/bundler/spec_set.rb | 3 +-- 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 -- cgit v1.2.3