diff --git a/bundler/lib/bundler/spec_set.rb b/bundler/lib/bundler/spec_set.rb index a19d18388ab8..44715c356743 100644 --- a/bundler/lib/bundler/spec_set.rb +++ b/bundler/lib/bundler/spec_set.rb @@ -24,7 +24,7 @@ def for(dependencies, check = false, match_current_platform = false) specs_for_dep = spec_for_dependency(dep, match_current_platform) if specs_for_dep.any? - match_current_platform ? specs += specs_for_dep : specs |= specs_for_dep + specs.concat(specs_for_dep) specs_for_dep.first.dependencies.each do |d| next if d.type == :development @@ -40,6 +40,8 @@ def for(dependencies, check = false, match_current_platform = false) specs << spec end + specs.uniq! unless match_current_platform + check ? true : specs end