abstract class MStrap::Runtime

Overview

Base class for working with language runtimes

Included Modules

Direct Known Subclasses

Defined in:

mstrap/runtime.cr

Constructors

Instance Method Summary

Instance methods inherited from module MStrap::DSL::System

cmd(env : Hash | Nil, command : String, args : Array(String) | Nil, **kwargs) cmd, has_command?(command_name : String, **kwargs) : Bool has_command?

Instance methods inherited from module MStrap::DSL::Logging

log(msg) log, logc(msg) logc, logd(msg) logd, logn(msg) logn, logw(msg) logw, success(msg) success

Constructor Detail

def self.new(runtime_manager : RuntimeManager) #

[View source]

Instance Method Detail

abstract def bootstrap #

Bootstrap the current directory for the runtime


[View source]
def current_version #

Returns the version of the language runtime used by the current directory or specified by the environment.

NOTE This will not traverse parent directories to find versions files.


[View source]
def has_runtime_plugin? #

Returns whether the ASDF plugin has been installed for a language runtime or not


[View source]
def has_version?(version) #

[View source]
def has_versions? #

Returns whether any versions of the language runtime have been installed by ASDF.


[View source]
abstract def install_packages(packages : Array(Defs::PkgDef), runtime_version : String | Nil = nil) : Bool #

Installs global packages for the runtime with an optional version specification, and optional runtime version.

NOTE The version specification is dependent upon the underlying package manager and is passed verbatim.


[View source]
def installed_versions #

Returns a list of the versions of the language runtime installed by ASDF.


[View source]
def language_name : String #

Name of the language as a string. Always lowercase.


[View source]
def latest_version #

Returns the latest version available for the language runtime, according to the runtime manager


[View source]
abstract def matches? : Bool #

Returns whether the project uses the runtime


[View source]
def runtime_exec(command : String, args : Array(String) | Nil = nil, runtime_version : String | Nil = nil) #

Execute a command using a specific language runtime version


[View source]
def runtime_manager : MStrap::RuntimeManager #

[View source]
def setup #

Installs runtime manager plugin for the language runtime and installs any of the language runtime dependencies for the project.


[View source]
def with_dir_version(dir, &) #

Executes the block's context using the given directory's language runtime version or the version specified by the environment.

NOTE This will not traverse parent directories to find versions files.


[View source]