diff options
Diffstat (limited to 'lib/bundler/spec_set.rb')
-rw-r--r-- | lib/bundler/spec_set.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 85a9d1537b..06257ac93f 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -24,13 +24,13 @@ module Bundler # use a hash here to ensure constant lookup time in the `any?` call above handled[dep.name] << dep - specs_for_dep = spec_for_dependency(dep, match_current_platform) + specs_for_dep = specs_for_dependency(dep, match_current_platform) if specs_for_dep.any? specs.concat(specs_for_dep) specs_for_dep.first.dependencies.each do |d| next if d.type == :development - d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform + d = DepProxy.get_proxy(Dependency.new(d.name, d.requirement), dep.__platform) unless match_current_platform deps << d end elsif check @@ -173,12 +173,13 @@ module Bundler @specs.sort_by(&:name).each {|s| yield s } end - def spec_for_dependency(dep, match_current_platform) - specs_for_platforms = lookup[dep.name] + def specs_for_dependency(dep, match_current_platform) + specs_for_name = lookup[dep.name] if match_current_platform - GemHelpers.select_best_platform_match(specs_for_platforms.select {|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform) + GemHelpers.select_best_platform_match(specs_for_name, Bundler.local_platform) else - GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform) + specs_for_name_and_platform = GemHelpers.select_best_platform_match(specs_for_name, dep.force_ruby_platform ? Gem::Platform::RUBY : dep.__platform) + specs_for_name_and_platform.any? ? specs_for_name_and_platform : specs_for_name end end |