Parent

Included Modules

Class/Module Index [+]

Quicksearch

Facter::Core::DirectedGraph

Public Instance Methods

acyclic?() click to toggle source
# File lib/facter/core/directed_graph.rb, line 9
def acyclic?
  cycles.empty?
end
cycles() click to toggle source
# File lib/facter/core/directed_graph.rb, line 13
def cycles
  cycles = []
  each_strongly_connected_component do |component|
    cycles << component if component.size > 1
  end
  cycles
end
tsort() click to toggle source
# File lib/facter/core/directed_graph.rb, line 29
def tsort
  missing = Set.new(self.values.flatten) - Set.new(self.keys)

  if not missing.empty?
    raise MissingVertex, "Cannot sort elements; cannot depend on missing elements #{missing.to_a}"
  end

  super

rescue TSort::Cyclic
  raise CycleError, "Cannot sort elements; found the following cycles: #{cycles.inspect}"
end
tsort_each_child(node) click to toggle source
# File lib/facter/core/directed_graph.rb, line 23
def tsort_each_child(node)
  fetch(node, []).each do |child|
    yield child
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.