method

add_found_dependencies

Importance_0
add_found_dependencies(to_do, dependency_list) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/dependency_installer.rb, line 112
  def add_found_dependencies to_do, dependency_list # :nodoc:
    seen = {}
    dependencies = Hash.new { |h, name| h[name] = Gem::Dependency.new name }

    until to_do.empty? do
      spec = to_do.shift

      # HACK why is spec nil?
      next if spec.nil? or seen[spec.name]
      seen[spec.name] = true

      deps = spec.runtime_dependencies

      if @development
        if @dev_shallow
          if @toplevel_specs.include? spec.full_name
            deps |= spec.development_dependencies
          end
        else
          deps |= spec.development_dependencies
        end
      end

      deps.each do |dep|
        dependencies[dep.name] = dependencies[dep.name].merge dep

        if @minimal_deps
          next if Gem::Specification.any? do |installed_spec|
                    dep.name == installed_spec.name and
                      dep.requirement.satisfied_by? installed_spec.version
                  end
        end

        results = find_gems_with_sources(dep)

        results.sorted.each do |t|
          to_do.push t.spec
        end

        results.remove_installed! dep

        @available << results
        results.inject_into_list dependency_list
      end
    end

    dependency_list.remove_specs_unsatisfied_by dependencies
  end
Register or log in to add new notes.