class

MStrap::Runtime

Inherits MStrap::DSL / MStrap::DSL::System / MStrap::DSL::Logging / Reference / Object

Base class for working with language runtimes

Constructors

new(runtime_manager : RuntimeManager)
Source

Instance methods

bootstrap

Bootstrap the current directory for the runtime

Source
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.

Source
has_runtime_plugin?

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

Source
has_version?(version)
Source
has_versions?

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

Source
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.

Source
installed_versions

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

Source
language_name

Name of the language as a string. Always lowercase.

Source
latest_version

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

Source
matches?

Returns whether the project uses the runtime

Source
runtime_exec(command : String, args : Array(String) | Nil = nil, runtime_version : String | Nil = nil)

Execute a command using a specific language runtime version

Source
runtime_manager
Source
setup

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

Source
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.

Source