rubygems/rubygems/dependency_installer.rb
##
# Gathers all dependencies necessary for the installation from local and
# remote sources unless the ignore_dependencies was given.
Gathers all dependencies necessary for the installation from local and
remote sources unless the ignore_dependencies was given.
Gathers all dependencies necessary for the installation from local and remote sources unless the ignore_dependencies was given .
def gather_dependencies
    specs = @specs_and_sources.map { |spec,_| spec }
    dependency_list = Gem::DependencyList.new
    dependency_list.add(*specs)
    unless @ignore_dependencies then
      to_do = specs.dup
      seen = {}
      until to_do.empty? do
        spec = to_do.shift
        next if spec.nil? or seen[spec.name]
        seen[spec.name] = true
        spec.dependencies.each do |dep|
          results = find_gems_with_sources(dep).reverse 
          results.each do |dep_spec, source_uri|
            next if seen[dep_spec.name]
            @specs_and_sources << [dep_spec, source_uri]
            dependency_list.add dep_spec
            to_do.push dep_spec
          end
        end
      end
    end
    @gems_to_install = dependency_list.dependency_order.reverse
  end
def gather_dependencies specs = @specs_and_sources . map { | spec , _ | spec } dependency_list = Gem :: DependencyList . new dependency_list . add ( * specs ) unless @ignore_dependencies then to_do = specs . dup seen = { } until to_do . empty? do spec = to_do . shift next if spec . nil? or seen [ spec . name ] seen [ spec . name ] = true spec . dependencies . each do | dep | results = find_gems_with_sources ( dep ) . reverse results . each do | dep_spec , source_uri | next if seen [ dep_spec . name ] @specs_and_sources << [ dep_spec , source_uri ] dependency_list . add dep_spec to_do . push dep_spec end end end end @gems_to_install = dependency_list . dependency_order . reverse end
Gathers all dependencies necessary for the installation from local and
remote sources unless the ignore_dependencies was given.
Gathers all dependencies necessary for the installation from local and remote sources unless the ignore_dependencies was given .
# local gems first