struct Novika::Resolver::ResolutionSet

Overview

Represents an ordered set of Resolution objects.

Defined in:

novika/resolver.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

Instance Method Detail

def all_come_from_same?(& : RunnableGroup -> Bool) : Bool #

Returns whether all resolutions from this set come from the same RunnableGroup. RunnableGroup to match is selected by applying the block to all RunnableGroups in this set.


def app? : Bool #

Returns whether all resolutions in this set come from the same application RunnableGroup.


def append(resolution : Resolution) #

Appends a resolution to this set. In case this set already contains a resolution for the same path, the two resolutions are merged using Resolution#merge!.


def append(set : ResolutionSet) #

Appends an entire resolution set at once. Essentially the same as appending each Resolution from set.


def each(& : Resolution -> ) #

Yields resolutions in this resolution set.


def each_designation(root : RunnableRoot, & : Designation -> ) #

Yields environment designations for the given runnable root.

Environment designations are resolution sets coupled to an environment. That is, an environment designation is a "token" stating this environment should handle resolutions out of that resolution set.


def each_group(& : RunnableGroup, Resolution -> ) #

Yields all RunnableGroup objects that have contributed to this resolution set. The yielded groups can repeat.


def each_preamble_with_group(root : RunnableRoot, & : String, RunnableGroup -> ) #

Yields preambles of unique application and library RunnableGroups that have contributed to this resolution set, as well as the groups themselves.


def each_unique_app(& : RunnableGroup -> ) #

Yields unique application RunnableGroups that have contributed to this resolution set.


def each_unique_dependency(& : Resolution::Dependency -> ) #

Yields all unique Resolution::Dependency objects in this resolution set.


def each_unique_dependency_with_dependents(& : Resolution::Dependency, ResolutionSet -> ) #

Yields each unique Resolution::Dependency object followed by a ResolutionSet of its dependents.


def each_unique_group(& : RunnableGroup -> ) #

Yields all RunnableGroup objects that have contributed to this resolution set. The yielded groups do not repeat.


def each_unique_lib(& : RunnableGroup -> ) #

Yields unique library RunnableGroups that have contributed to this resolution set.


def empty? #

Returns whether there are no resolutions in this resolution set.


def groups : Array(RunnableGroup) #

Returns an array of RunnableGroup objects that have contributed to this resolution set. Objects in the array can repeat.


def lib? : Bool #

Returns whether all resolutions in this set come from the same library RunnableGroup.


def size #

Returns the amount of resolutions in this resolution set.


def to_s(io) #

def unique_apps : Array(RunnableGroup) #

Returns an array of unique application RunnableGroups that have contributed to this resolution set.