class Bundler::Molinillo::DependencyGraph
def initialize_copy(other)
Initializes a copy of a {DependencyGraph}, ensuring that all {#vertices}
def initialize_copy(other) super @vertices = other.vertices.reduce({}) do |vertices, (name, vertex)| vertices.tap do |hash| hash[name] = vertex.dup.tap { |v| v.graph = self } end end @root_vertices = Hash[@vertices.select { |n, _v| other.root_vertices[n] }] @edges = other.edges.map do |edge| Edge.new( vertex_named(edge.origin.name), vertex_named(edge.destination.name), edge.requirements.dup ) end end