diff options
author | Andre Arko <andre@arko.net> | 2014-08-16 13:02:45 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-08-16 13:02:45 -0700 |
commit | cc4c0df62d3550693693c9a8eefedaf4dedec734 (patch) | |
tree | 3fcd3209856473909d79aa547eb96f0b28df7538 | |
parent | 22c9173dd25c9e6e59fcc52a8784309f41e3ddd4 (diff) | |
download | bundler-cc4c0df62d3550693693c9a8eefedaf4dedec734.tar.gz |
normalise unmet_deps across all Sources
-rw-r--r-- | lib/bundler/definition.rb | 11 | ||||
-rw-r--r-- | lib/bundler/source.rb | 6 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 9 |
3 files changed, 17 insertions, 9 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 201a0b5eb3..466a39ccdd 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -201,14 +201,9 @@ module Bundler dependency_names.map! {|d| d.name } sources.all_sources.each do |s| - if s.is_a?(Bundler::Source::Rubygems) - s.dependency_names = dependency_names.uniq - idx.add_source s.specs - else - source_index = s.specs - dependency_names += source_index.unmet_dependency_names - idx.add_source source_index - end + s.dependency_names = dependency_names + idx.add_source s.specs + dependency_names.push(*s.unmet_deps).uniq! end end end diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index ce0cbb5dc2..04643b4977 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -14,6 +14,12 @@ module Bundler mirrors[normalized_key] || uri end + attr_accessor :dependency_names + + def unmet_deps + specs.unmet_dependency_names + end + def version_message(spec) locked_spec = Bundler.locked_gems.specs.find { |s| s.name == spec.name } if Bundler.locked_gems locked_spec_version = locked_spec.version if locked_spec diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index e8d847b126..581b2935dc 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -8,7 +8,6 @@ module Bundler API_REQUEST_LIMIT = 100 # threshold for switching back to the modern index instead of fetching every spec attr_reader :remotes, :caches - attr_accessor :dependency_names def initialize(options = {}) @options = options @@ -179,6 +178,14 @@ module Bundler end end + def unmet_deps + if fetchers.any? && fetchers.all?{|f| f.use_api } + remote_specs.unmet_dependency_names + else + [] + end + end + protected def source_uris_for_spec(spec) |