class Novika::Resolver::RunnableEnvironment

Overview

Represents a Novika environment.

Defined in:

novika/resolver.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(root : RunnableRoot, abspath : Path | Nil) #

Instance Method Detail

def ==(path : Path) #

Returns whether path points to this environment's directory.


def ==(other : self) #

Two environments are equal when their directories are equal.


def abspath #

Returns the absolute path pointing to this environment's directory.


def abspath? : Path? #

Returns the absolute path pointing to this environment's directory.


def brief(dependency : Resolution::Dependency) #

Returns a brief description of dependency as per this environment.


def capability?(datum : String) : Bool #

Returns whether datum is a capability in this environment's capability collection.


def designate(set : ResolutionSet) : Designation #

Creates and returns a Designation for this environment to handle the given resolution set.


def expand?(datum : Path) : Path | Nil #

Expands datum in this environment's directory. Returns the resulting real path if datum points to something (a file, a directory, etc.); if datum points to nothing, returns nil.


def hash(hasher) #

Two environments are equal when their directories are equal.


def includes?(path : Path) : Bool #

Returns whether path is part of this environment's subtree, i.e. is this environment directory's direct or indirect child.


def permissions(& : IO -> ) #

Yields writable IO for the content of this environment's permissions file. Creates the latter if necessary. Previous content of the permissions file is cleared.


def permissions? : Tuple(String, Path) | Nil #

Returns the content of the permissions file of this environment followed by the file's path; or nil if the permissions file does not exist.


def request(dependency : Resolution::Dependency, for container : RunnableContainer) #

Emits a dependency request (see Resolution::Dependency#request) to the permission server of this environment.