class Novika::Resolver::RunnableCapability

Overview

Capabilities represent the requirements of a Novika script, library, or application, regarding language features that are needed in order for that script, library, or application to properly work.

Included Modules

Defined in:

novika/resolver.cr

Constructors

Instance Method Summary

Instance methods inherited from module Novika::Resolver::Resolution::Dependency::DefaultPrompt

description?(server : PermissionServer) : String | Nil description?, envelope(container : RunnableContainer) envelope, label(server : PermissionServer) : String label, prompt?(server : PermissionServer, *, for container : RunnableContainer) : Permission prompt?

Instance methods inherited from module Novika::Resolver::Resolution::Dependency

allow allow, allowed? : Bool allowed?, deny deny, enable(*, in caps : CapabilityCollection) enable, prompt?(server : PermissionServer, *, for container : RunnableContainer) : Permission prompt?, request(server : PermissionServer, *, for container : RunnableContainer) request, signature(container : RunnableContainer) : Signature signature

Instance methods inherited from module Novika::Resolver::Runnable::Terminal

specialize(root : RunnableRoot, container : RunnableContainer) specialize

Instance methods inherited from module Novika::Resolver::Runnable::HasDatum(String)

==(other : T)
==(other : self)
==
, hash(hasher) hash

Instance methods inherited from class Novika::Resolver::Runnable

ancestor? : Ancestor | Nil ancestor?, ancestors : Array(Ancestor) ancestors, backtrace(io : IO, indent : Int32 = 0, annex : String | Nil = nil)
backtrace(*args, **kwargs, & : IO -> )
backtrace
, constituents : Array(Runnable) constituents, each_ancestor(& : Ancestor -> ) each_ancestor, specialize(root : RunnableRoot, container : RunnableContainer) specialize

Constructor methods inherited from class Novika::Resolver::Runnable

new(ancestor : Ancestor | Nil = nil) new

Instance methods inherited from module Novika::Resolver::Runnable::Ancestor

ancestor? : Ancestor | Nil ancestor?

Constructor Detail

def self.new(datum : String, ancestor = nil) #

Instance Method Detail

def description?(server : PermissionServer) : String | Nil #

Returns a user-friendly description of this dependency, or nil if none can be given. The returned description should be suitable for displaying to the user in a prompt, and should read well after "which", as in "which [exposes this and that]", "which [allows this and that]", etc., where words in brackets are those of the description.

server is the server that will then use the description in one way or another, in case it is present. You may also choose to derive the description with server's help.


def enable(*, in caps : CapabilityCollection) #
Description copied from module Novika::Resolver::Resolution::Dependency

If this dependency is allowed?, enables it in the given capability collection caps.


def envelope(container : RunnableContainer) #

Returns the string representation of this dependency's envelope (its container so to speak). The runtime (not specialize-time!) container is provided as a fallback option (albeit a very bad one).


def label(server : PermissionServer) : String #

Returns a user-friendly string representation of this dependency. The returned string should be suitable for displaying to the user in a prompt.

server is the permission server that will then use the label in one way or another. You may also choose to derive the label with server's help.


def purpose(*, in caps : CapabilityCollection) #

Returns the purpose of this capability in the given capability collection caps.


def signature(container : RunnableContainer) : Signature #
Description copied from module Novika::Resolver::Resolution::Dependency

Returns the signature of this dependency which can be used to identify it, most notably in the 'permissions' file.

container, assumed to contain this dependency, may be used to derive the signature.


def specialize(root : RunnableRoot, container : RunnableContainer) #
Description copied from class Novika::Resolver::Runnable

Further specializes this runnable. Appends the specialized runnable to (or interacts in some other way with) container. The latter is assumed to be incomplete (or partially complete, which is really the same thing).

root is the runnable root object. It is mainly used for flags and thorough rewriting.


def to_s(io) #