module RemiLib::DependencyGraph

Overview

A simple way to specify dependencies between items. This particular implementation does not support circular references.

Defined in:

remilib/dependencygraph.cr

Class Method Summary

Class Method Detail

def self.getOrder(deps : Array(Node(N, T))) : Array(N) forall N, T #

Resolves the dependency graph, then returns the order for the dependencies as an array of N. Essentially, a dry run.


[View source]
def self.getOrder(*deps : Node(N, T)) : Array(N) forall N, T #

Resolves the dependency graph, then returns the order for the dependencies as an array of N. Essentially, a dry run.


[View source]
def self.run(root : Node(N, T), fn : Proc(N, T, Nil)) : Int forall N, T #

Resolves the dependency graph, calling fn for each item in the graph in the order of their dependencies. Returns the number of dependencies that were resolved.


[View source]
def self.run(fn : Proc(N, T, Nil), deps : Array(Node(N, T))) : Nil forall N, T #

Resolves the dependency graph, calling fn for each item in the graph in the order of their dependencies. Returns the number of dependencies that were resolved.


[View source]
def self.run(fn : Proc(N, T, Nil), *deps : Node(N, T)) : Nil forall N, T #

Resolves the dependency graph, calling fn for each item in the graph in the order of their dependencies. Returns the number of dependencies that were resolved.


[View source]