diff options
author | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 14:22:09 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2020-01-15 14:22:09 +0900 |
commit | 71f74179718f065ee3eb951dc81cc0cec767d583 (patch) | |
tree | 509fec1696b7e093fb57b4267e74c5033b70fb90 /lib/bundler | |
parent | 3144c069458bf74070424e675321887e2105e883 (diff) | |
download | bundler-71f74179718f065ee3eb951dc81cc0cec767d583.tar.gz |
Sort available platforms
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/resolver.rb | 15 |
1 files changed, 8 insertions, 7 deletions
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 |