Class: Bundler::Molinillo::DependencyGraph::Vertex

### Home Classes Methods

### In Files

- lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb

### Parent

Object

### Methods

- ::new
- #==
- #ancestor?
- #descendent?
- #eql?
- #hash
- #incoming_edges
- #inspect
- #is_reachable_from?
- #outgoing_edges
- #path_to?
- #predecessors
- #recursive_successors
- #requirements
- #shallow_eql?
- #successors

### Files

- bundle
- bundle-config
- bundle-config.txt
- bundle-exec
- bundle-exec.txt
- bundle-install
- bundle-install.txt
- bundle-package
- bundle-package.txt
- bundle-platform
- bundle-platform.txt
- bundle-update
- bundle-update.txt
- bundle.txt
- gemfile.5.txt
- Executable
- Gemfile

### Class/Module Index

Quicksearch

- Bundler
- Bundler::BundlerError
- Bundler::CLI
- Bundler::CLI::Binstubs
- Bundler::CLI::Cache
- Bundler::CLI::Check
- Bundler::CLI::Clean
- Bundler::CLI::Common
- Bundler::CLI::Config
- Bundler::CLI::Console
- Bundler::CLI::Exec
- Bundler::CLI::Gem
- Bundler::CLI::Init
- Bundler::CLI::Inject
- Bundler::CLI::Install
- Bundler::CLI::Lock
- Bundler::CLI::Open
- Bundler::CLI::Outdated
- Bundler::CLI::Package
- Bundler::CLI::Platform
- Bundler::CLI::Show
- Bundler::CLI::Update
- Bundler::CLI::Viz
- Bundler::CurrentRuby
- Bundler::CyclicDependencyError
- Bundler::Definition
- Bundler::DepProxy
- Bundler::Dependency
- Bundler::Deployment
- Bundler::Deprecate
- Bundler::DeprecatedError
- Bundler::Dsl
- Bundler::Dsl::DSLError
- Bundler::EndpointSpecification
- Bundler::Env
- Bundler::Environment
- Bundler::Fetcher
- Bundler::Fetcher::AuthenticationRequiredError
- Bundler::Fetcher::BadAuthenticationError
- Bundler::Fetcher::Base
- Bundler::Fetcher::CertificateFailureError
- Bundler::Fetcher::Dependency
- Bundler::Fetcher::Downloader
- Bundler::Fetcher::FallbackError
- Bundler::Fetcher::Index
- Bundler::Fetcher::NetworkDownError
- Bundler::Fetcher::SSLError
- Bundler::GemHelper
- Bundler::GemHelpers
- Bundler::GemInstaller
- Bundler::GemNotFound
- Bundler::GemfileError
- Bundler::GemfileLockNotFound
- Bundler::GemfileNotFound
- Bundler::GemspecError
- Bundler::GitError
- Bundler::Graph
- Bundler::Graph::GraphVizClient
- Bundler::HTTPError
- Bundler::Index
- Bundler::Injector
- Bundler::InstallError
- Bundler::InstallHookError
- Bundler::Installer
- Bundler::InvalidOption
- Bundler::LazySpecification
- Bundler::LockfileError
- Bundler::LockfileParser
- Bundler::MarshalError
- Bundler::MatchPlatform
- Bundler::Molinillo
- Bundler::Molinillo::CircularDependencyError
- Bundler::Molinillo::DependencyGraph
- Bundler::Molinillo::DependencyGraph::Vertex
- Bundler::Molinillo::DependencyState
- Bundler::Molinillo::NoSuchDependencyError
- Bundler::Molinillo::PossibilityState
- Bundler::Molinillo::Resolver
- Bundler::Molinillo::Resolver::Resolution
- Bundler::Molinillo::ResolverError
- Bundler::Molinillo::SpecificationProvider
- Bundler::Molinillo::UI
- Bundler::Molinillo::VersionConflict
- Bundler::PathError
- Bundler::ProductionError
- Bundler::RemoteSpecification
- Bundler::Resolver
- Bundler::Resolver::Molinillo
- Bundler::Resolver::Molinillo::VersionConflict
- Bundler::Resolver::SpecGroup
- Bundler::Retry
- Bundler::RubyDsl
- Bundler::RubyVersion
- Bundler::RubyVersionMismatch
- Bundler::RubygemsIntegration
- Bundler::RubygemsIntegration::AlmostModern
- Bundler::RubygemsIntegration::Ancient
- Bundler::RubygemsIntegration::Future
- Bundler::RubygemsIntegration::Gem
- Bundler::RubygemsIntegration::Legacy
- Bundler::RubygemsIntegration::Legacy::Gem::SourceIndex
- Bundler::RubygemsIntegration::Modern
- Bundler::RubygemsIntegration::MoreFuture
- Bundler::RubygemsIntegration::MoreModern
- Bundler::RubygemsIntegration::Transitional
- Bundler::Runtime
- Bundler::SecurityError
- Bundler::Settings
- Bundler::SharedHelpers
- Bundler::SimilarityDetector
- Bundler::Source
- Bundler::Source::Git
- Bundler::Source::Git::GitCommandError
- Bundler::Source::Git::GitNotAllowedError
- Bundler::Source::Git::GitNotInstalledError
- Bundler::Source::Git::GitProxy
- Bundler::Source::Path
- Bundler::Source::Path::Installer
- Bundler::Source::Rubygems
- Bundler::Source::Rubygems::Remote
- Bundler::SourceList
- Bundler::SpecSet
- Bundler::StubSpecification
- Bundler::SystemRubyVersion
- Bundler::Thor
- Bundler::Thor::Actions
- Bundler::Thor::Actions::ClassMethods
- Bundler::Thor::AmbiguousCommandError
- Bundler::Thor::Base
- Bundler::Thor::Base::ClassMethods
- Bundler::Thor::Command
- Bundler::Thor::DynamicCommand
- Bundler::Thor::Error
- Bundler::Thor::Group
- Bundler::Thor::HiddenCommand
- Bundler::Thor::Invocation
- Bundler::Thor::Invocation::ClassMethods
- Bundler::Thor::InvocationError
- Bundler::Thor::LineEditor
- Bundler::Thor::LineEditor::Basic
- Bundler::Thor::LineEditor::Readline
- Bundler::Thor::LineEditor::Readline::PathCompletion
- Bundler::Thor::MalformattedArgumentError
- Bundler::Thor::RakeCompat
- Bundler::Thor::RequiredArgumentMissingError
- Bundler::Thor::Shell
- Bundler::Thor::Shell::Basic
- Bundler::Thor::Shell::Color
- Bundler::Thor::Shell::HTML
- Bundler::Thor::UndefinedCommandError
- Bundler::Thor::UnknownArgumentError
- Bundler::Thor::Util
- Bundler::UI
- Bundler::UI::RGProxy
- Bundler::UI::Shell
- Bundler::UI::Silent
- Bundler::VersionConflict
- Bundler::Worker
- Bundler::Worker::WrappedException
- Gem
- Gem::Dependency
- Gem::Platform
- Gem::Requirement
- Gem::Specification
- Net
- Net::HTTP
- Net::HTTP::Persistent
- Net::HTTP::Persistent::Error
- Net::HTTP::Persistent::SSLReuse
- ParallelInstaller
- ParallelInstaller::SpecInstallation
- Object

No matching classes.

# Bundler::Molinillo::DependencyGraph::Vertex

A vertex in a {DependencyGraph} that encapsulates a {name} and a {payload}

### Attributes

explicit_requirements[R]

@return [Arrary<Object>] the explicit requirements that required

    this vertex

graph[RW]

@return [DependencyGraph] the graph this vertex is a node of

name[RW]

@return [String] the name of the vertex

payload[RW]

@return [Object] the payload the vertex holds

### Public Class Methods

new(graph, name, payload) click to toggle source

@param [DependencyGraph] graph see {graph} @param [String] name see {name} @param [Object] payload see {payload}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 177
    def initialize(graph, name, payload)
      @graph = graph
      @name = name
      @payload = payload
      @explicit_requirements = []
    end

### Public Instance Methods

==(other) click to toggle source

@return [Boolean] whether the two vertices are equal, determined

    by a recursive traversal of each {Vertex#successors}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 227
    def ==(other)
      shallow_eql?(other) &&
        successors == other.successors
    end

Also aliased as: eql?
ancestor?(other) click to toggle source

Is there a path from `other` to `self` following edges in the dependency graph? @return true iff there is a path following edges within this {graph}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 259
    def ancestor?(other)
      predecessors.include?(other) || predecessors.any? { |v| v.ancestor?(other) }
    end

Also aliased as: is_reachable_from?
descendent?(other) click to toggle source
Alias for: path_to?
eql?(other) click to toggle source
Alias for: ==
hash() click to toggle source

@return [Fixnum] a hash for the vertex based upon its {name}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 243
    def hash
      name.hash
    end

incoming_edges() click to toggle source

@return [Array<Edge>] the edges of {graph} that have `self` as their

    {Edge#destination}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 198
    def incoming_edges
      graph.edges.select { |e| e.destination.shallow_eql?(self) }
    end

inspect() click to toggle source

@return [String] a string suitable for debugging

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 221
    def inspect
      "#{self.class}:#{name}(#{payload.inspect})"
    end

is_reachable_from?(other) click to toggle source
Alias for: ancestor?
outgoing_edges() click to toggle source

@return [Array<Edge>] the edges of {graph} that have `self` as their

    {Edge#origin}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 192
    def outgoing_edges
      graph.edges.select { |e| e.origin.shallow_eql?(self) }
    end

path_to?(other) click to toggle source

Is there a path from `self` to `other` following edges in the dependency graph? @return true iff there is a path following edges within this {graph}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 250
    def path_to?(other)
      successors.include?(other) || successors.any? { |v| v.path_to?(other) }
    end

Also aliased as: descendent?
predecessors() click to toggle source

@return [Set<Vertex>] the vertices of {graph} that have an edge with

    `self` as their {Edge#destination}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 204
    def predecessors
      incoming_edges.map(&:origin).to_set
    end

recursive_successors() click to toggle source

@return [Set<Vertex>] the vertices of {graph} where `self` is an

    {#ancestor?}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 216
    def recursive_successors
      successors + successors.map(&:recursive_successors).reduce(Set.new, &:+)
    end

requirements() click to toggle source

@return [Array<Object>] all of the requirements that required

    this vertex

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 186
    def requirements
      incoming_edges.map(&:requirements).flatten + explicit_requirements
    end

shallow_eql?(other) click to toggle source

@return [Boolean] whether the two vertices are equal, determined

    solely by {#name} and {#payload} equality

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 234
    def shallow_eql?(other)
      other &&
        name == other.name &&
        payload == other.payload
    end

successors() click to toggle source

@return [Set<Vertex>] the vertices of {graph} that have an edge with

    `self` as their {Edge#origin}

    # File lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb, line 210
    def successors
      outgoing_edges.map(&:destination).to_set
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.