lib/inventory_refresh/graph.rb
def detect_cycle(edge, acyclic_edges, escalation = nil)
      # Test if adding edge creates a cycle, ew will traverse the graph from edge Node, through all it's
      # dependencies
      starting_node = edge.second
      edges         = [edge] + acyclic_edges
      traverse_dependecies([], starting_node, starting_node, edges, node_edges(edges, starting_node), escalation)
    end
def detect_cycle(edge, acyclic_edges, escalation = nil)
      # Test if adding edge creates a cycle, ew will traverse the graph from edge Node, through all it's
      # dependencies
      starting_node = edge.second
      edges         = [edge] + acyclic_edges
      traverse_dependecies([], starting_node, starting_node, edges, node_edges(edges, starting_node), escalation)
    end
def detect_cycle ( edge , acyclic_edges , escalation = nil ) # Test if adding edge creates a cycle, ew will traverse the graph from edge Node, through all it's # dependencies starting_node = edge . second edges = [ edge ] + acyclic_edges traverse_dependecies ( [ ] , starting_node , starting_node , edges , node_edges ( edges , starting_node ) , escalation ) end
Detects a cycle. Based on escalation returns true or raises exception if there is a cycle

 @param edge [Array(InventoryRefresh::InventoryCollection, InventoryRefresh::InventoryCollection)] Edge we are
        inspecting for cycle
 @param acyclic_edges [Array<Array>] Starting with fixed edges that can't have cycle, these are edges without cycle
 @param escalation [Symbol] If :exception, this method throws exception when it finds a cycle
 @return [Boolean, Exception] Based on escalation returns true or raises exception if there is a cycle
Detects a cycle . Based on escalation returns true or raises exception if there is a cycle