class Novika::Resolver::RunnableSharedObject

Overview

Runnable representation of a shared object. Shared objects are accessed via FFI Novika-side.

Included Modules

Defined in:

novika/resolver.cr

Constant Summary

EXTENSION = ".so"

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(Path)

==(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 : Path, ancestor = nil) #

Instance Method Detail

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 id #

Returns the id of this shared object.

The id is made by taking the stem of the path to the object and stripping it of the lib prefix, if it has one. For example, given /lib/libmath.so or /lib/math.so, the id would be math in both cases.


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 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) #