summaryrefslogtreecommitdiff
path: root/lib/bundler/gem_helpers.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-07-23 08:44:47 +0200
committergit <svn-admin@ruby-lang.org>2022-08-02 16:10:18 +0900
commitf4f681463f71c2fc63e1a07f36f2665f2b9db002 (patch)
tree6d9c7f6b576fdfcd480156bdbd2ce6b20141307f /lib/bundler/gem_helpers.rb
parent9189c2d5efa94131050df4994c801fb187d7b43d (diff)
[rubygems/rubygems] Don't discard candidates matching ruby metadata
Do dependency filtering and materialization in one step. Before, dependency filtering would not consider ruby metadata so it would discard variants that end up not being materializable in the end. https://github.com/rubygems/rubygems/commit/0c0d40d417 Co-authored-by: Ian Ker-Seymer <ian.kerseymer@shopify.com>
Diffstat (limited to 'lib/bundler/gem_helpers.rb')
-rw-r--r--lib/bundler/gem_helpers.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb
index 6bc4fb4991..0d50d8687b 100644
--- a/lib/bundler/gem_helpers.rb
+++ b/lib/bundler/gem_helpers.rb
@@ -44,6 +44,12 @@ module Bundler
def select_best_platform_match(specs, platform)
matching = specs.select {|spec| spec.match_platform(platform) }
+
+ sort_best_platform_match(matching, platform)
+ end
+ module_function :select_best_platform_match
+
+ def sort_best_platform_match(matching, platform)
exact = matching.select {|spec| spec.platform == platform }
return exact if exact.any?
@@ -52,7 +58,7 @@ module Bundler
sorted_matching.take_while {|spec| same_specificity(platform, spec, exemplary_spec) && same_deps(spec, exemplary_spec) }
end
- module_function :select_best_platform_match
+ module_function :sort_best_platform_match
class PlatformMatch
def self.specificity_score(spec_platform, user_platform)