abstract class MStrap::Runtime

Overview

Base class for working with language runtimes

Included Modules

Direct Known Subclasses

Defined in:

mstrap/runtime.cr

Instance Method Summary

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

cmd(env : Hash | Nil, command : String, args : Array(String) | Nil, shell = true, input = Process::Redirect::Inherit, output = Process::Redirect::Inherit, error = Process::Redirect::Inherit, quiet = false, sudo = false) cmd

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

Instance Method Detail

def asdf_exec(command : String, args : Array(String), runtime_version : String | Nil = nil) #

Execute a command using a specific language runtime version


[View source]
def asdf_install_plugin #

[View source]
def asdf_plugin_name : String #

Name of the ASDF plugin. Defaults to language_name


[View source]
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_asdf_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]
abstract 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 asdf plugin


[View source]
abstract def matches? : Bool #

Returns whether the project uses the runtime


[View source]
def setup #

Installs asdf 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]