Class Bundler::Molinillo::DependencyGraph
In: lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb
lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb
Parent: Object

A directed acyclic graph that is tuned to hold named dependencies

Methods

Included Modules

Enumerable TSort

Classes and Modules

Class Bundler::Molinillo::DependencyGraph::Action
Class Bundler::Molinillo::DependencyGraph::AddEdgeNoCircular
Class Bundler::Molinillo::DependencyGraph::DeleteEdge
Class Bundler::Molinillo::DependencyGraph::DetachVertexNamed
Class Bundler::Molinillo::DependencyGraph::Log
Class Bundler::Molinillo::DependencyGraph::Tag
Class Bundler::Molinillo::DependencyGraph::Vertex

Constants

Edge = Struct.new(:origin, :destination, :requirement)   A directed edge of a {DependencyGraph} @attr [Vertex] origin The origin of the directed edge @attr [Vertex] destination The destination of the directed edge @attr [Object] requirement The requirement the directed edge represents

Attributes

log  [R]  @return [Log] the op log for this graph
vertices  [R]  @return [{String => Vertex}] the vertices of the dependency graph, keyed
  by {Vertex#name}

Public Class methods

Initializes an empty dependency graph

Topologically sorts the given vertices. @param [Enumerable<Vertex>] vertices the vertices to be sorted, which must

  all belong to the same graph.

@return [Array<Vertex>] The sorted vertices.

Public Instance methods

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

  by a recursive traversal of each {#root_vertices} and its
  {Vertex#successors}

@param [String] name @param [Object] payload @param [Array<String>] parent_names @param [Object] requirement the requirement that is requiring the child @return [void]

Adds a new {Edge} to the dependency graph @param [Vertex] origin @param [Vertex] destination @param [Object] requirement the requirement that this edge represents @return [Edge] the added edge

Adds a vertex with the given name, or updates the existing one. @param [String] name @param [Object] payload @return [Vertex] the vertex that was added to `self`

Deletes an {Edge} from the dependency graph @param [Edge] edge @return [Void]

Detaches the {vertex_named} `name` {Vertex} from the graph, recursively removing any non-root vertices that were orphaned in the process @param [String] name @return [Array<Vertex>] the vertices which have been detached

Enumerates through the vertices of the graph. @return [Array<Vertex>] The graph‘s vertices.

Initializes a copy of a {DependencyGraph}, ensuring that all {vertices} are properly copied. @param [DependencyGraph] other the graph to copy.

@return [String] a string suitable for debugging

Rewinds the graph to the state tagged as `tag` @param [Object] tag the tag to rewind to @return [Void]

@param [String] name @return [Vertex,nil] the root vertex with the given name

Sets the payload of the vertex with the given name @param [String] name the name of the vertex @param [Object] payload the payload @return [Void]

Tags the current state of the dependency as the given tag @param [Object] tag an opaque tag for the current state of the graph @return [Void]

@param [Hash] options options for dot output. @return [String] Returns a dot format representation of the graph

tsort_each_node()

Alias for each

@param [String] name @return [Vertex,nil] the vertex with the given name

[Validate]