struct Novika::Resolver::Resolution

Overview

Obtaining a set of resolution objects from an initial list of queries is the central goal of the resolver.

A resolution object points to a script and lists its dependencies. Furthermore, a resolution object also stores its so-called runnable sources, which are RunnableScript objects that it was derived from.

Defined in:

novika/resolver.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(script : RunnableScript, deps : Set(Dependency)) #

Initializes a runnable resolution for the given runnable script and a set of resolution dependency objects deps.


Instance Method Detail

def ==(other : self) #

Two resolutions are considered equal when they point to the same script on the disk.


def abspath : Path #

Returns the absolute path to this resolution.


def dump!(deps : Set(Dependency) | Nil = nil, sources : Array(RunnableScript) | Nil = nil) #

Appends the dependencies of this resolution to deps, source scripts of this resolution to sources.


def each_dependency(& : Dependency -> ) #

Yields dependencies of this resolution.


def each_source_group(& : RunnableGroup -> ) #

Yields all RunnableGroups from the ancestry of source scripts of this resolution. Does not yield the same group twice (sameness is determined with #==/hash).


def hash(hasher) #

Two resolutions are considered equal when they point to the same script on the disk.


def merge!(other : Resolution) : self #

Mutably merges this and other resolutions.


def run(engine : Engine, script_block : Block) : Block #

Opens an instance of script block (aka file block) with engine.

Extends script block itself with __path__, __file__; therefore, mutates script block.

Returns the script block instance after evaluation.


def to_s(io) #