diff options
Diffstat (limited to 'lib/bundler/index.rb')
-rw-r--r-- | lib/bundler/index.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index 5f54796fa2..fd4dea32e7 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -131,6 +131,19 @@ module Bundler names.uniq end + def dependency_names_if_available + reduce([]) do |names, spec| + case spec + when EndpointSpecification, Gem::Specification, LazySpecification, StubSpecification + names.concat(spec.dependencies) + when RemoteSpecification # from the full index + return nil + else + raise "unhandled spec type in #dependency_names_if_available (#{spec.inspect})" + end + end.tap {|n| n && n.map!(&:name) } + end + def use(other, override_dupes = false) return unless other other.each do |s| |