diff options
author | Andre Arko <andre@arko.net> | 2015-02-07 10:09:09 +1100 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-02-09 15:46:12 +1100 |
commit | dc6e577ab0c0ae37bf34b464ab55f52270b69b54 (patch) | |
tree | 53fa70326d9468700e618fa7637de93b224dad9a /lib/bundler | |
parent | 9263e08636d25e2573776b17416e6fabd403026b (diff) | |
download | bundler-dc6e577ab0c0ae37bf34b464ab55f52270b69b54.tar.gz |
remove dep names based on pinned state
this should be much more reliable than assuming that git and path gems
are pinned and other gems are not, once we make it to the block-required
future.
Conflicts:
lib/bundler/definition.rb
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/definition.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index bb9d28d6..59f8a69d 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -202,11 +202,7 @@ module Bundler sources.all_sources.each do |source| source.dependency_names = dependency_names.dup idx.add_source source.specs - - if source.is_a?(Source::Git) || source.is_a?(Source::Path) - dependency_names -= source.specs.map{|s| s.name }.uniq - end - + dependency_names -= pinned_spec_names(source.specs) dependency_names.push(*source.unmet_deps).uniq! end end @@ -603,5 +599,19 @@ module Bundler source_requirements end + def pinned_spec_names(specs) + names = [] + specs.each do |s| + # TODO when two sources without blocks is an error, we can change + # this check to !s.source.is_a?(Source::LocalRubygems). For now, + # we need to ask every Rubygems for every gem name. + if s.source.is_a?(Source::Git) || s.source.is_a?(Source::Path) + names << s.name + end + end + names.uniq! + names + end + end end |