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 #

[View source]

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.


[View source]
def app? : Bool #

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


[View source]
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!.


[View source]
def append(set : ResolutionSet) #

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


[View source]
def each(& : Resolution -> ) #

Yields resolutions in this resolution set.


[View source]
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.


[View source]
def each_group(& : RunnableGroup, Resolution -> ) #

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


[View source]
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.


[View source]
def each_unique_app(& : RunnableGroup -> ) #

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


[View source]
def each_unique_dependency(& : Resolution::Dependency -> ) #

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


[View source]
def each_unique_dependency_with_dependents(& : Resolution::Dependency, ResolutionSet -> ) #

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


[View source]
def each_unique_group(& : RunnableGroup -> ) #

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


[View source]
def each_unique_lib(& : RunnableGroup -> ) #

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


[View source]
def empty? #

Returns whether there are no resolutions in this resolution set.


[View source]
def groups : Array(RunnableGroup) #

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


[View source]
def lib? : Bool #

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


[View source]
def size #

Returns the amount of resolutions in this resolution set.


[View source]
def to_s(io) #

[View source]
def unique_apps : Array(RunnableGroup) #

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


[View source]