Flowdock
method

add_found_dependencies

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: DependencyInstaller
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 159
  def add_found_dependencies to_do, dependency_list
    seen = {}
    dependencies = Hash.new { |h, name| h[name] = Gem::Dependency.new name }

    until to_do.empty? do
      spec = to_do.shift
      next if spec.nil? or seen[spec.name]
      seen[spec.name] = true

      deps = spec.runtime_dependencies
      deps |= spec.development_dependencies if @development

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

        results = find_gems_with_sources(dep).reverse

        results.reject! do |dep_spec,|
          to_do.push dep_spec

          # already locally installed
          Gem::Specification.any? do |installed_spec|
            dep.name == installed_spec.name and
              dep.requirement.satisfied_by? installed_spec.version
          end
        end

        results.each do |dep_spec, source_uri|
          @specs_and_sources << [dep_spec, source_uri]

          dependency_list.add dep_spec
        end
      end
    end

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