From 71f74179718f065ee3eb951dc81cc0cec767d583 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 15 Jan 2020 14:22:09 +0900 Subject: Sort available platforms --- lib/bundler/resolver.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 2d0d63d557..bcde144f76 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -154,14 +154,15 @@ module Bundler # spec group. sg_ruby = sg.copy_for(Gem::Platform::RUBY) selected_sgs << sg_ruby if sg_ruby - sg_all_platforms = sg.copy_for(platform) - activated_platforms = [platform] - @platforms.each do |other_platform| - next if platform == other_platform - sg_all_platforms.activate_platform!(other_platform) - activated_platforms << other_platform + sg_all_platforms = nil + self.class.sort_platforms(@platforms).reverse_each do |other_platform| + if sg_all_platforms.nil? + sg_all_platforms = sg.copy_for(other_platform) + else + sg_all_platforms.activate_platform!(other_platform) + end end - selected_sgs << sg_all_platforms + selected_sgs << sg_all_platforms if sg_all_platforms end selected_sgs end -- cgit v1.2.1