Module: HostOS::Interpreter
- Defined in:
- lib/host-os/interpreter.rb
Overview
This module allows to identify the used Ruby interpreter.
Besides here documented boolean attributes you can also check for any other boolean attribute or interpreter name:
Class Attribute Summary collapse
-
.cardinal? ⇒ true, false
(also: parrot?)
readonly
Whether the interpreter is the Parrot based Cardinal interpreter.
-
.exe ⇒ String?
readonly
Path name of current Ruby executable.
-
.id ⇒ Symbol
readonly
Interpreter identifier.
-
.jit_enabled? ⇒ true, false
readonly
Whether the interpreter currently uses a JIT Compiler.
-
.jit_modules ⇒ Array<Module>
readonly
Available JIT Modules.
-
.jit_type ⇒ :java, ...
readonly
Type of currently used JIT Compiler.
-
.jruby? ⇒ true, false
(also: java?)
readonly
Whether the interpreter is the Java based JRuby Interpreter.
-
.mri? ⇒ true, false
(also: cruby?, default?)
readonly
Whether the interpreter is the Yukihiro Matsumoto's C-based (default) Ruby Interpreter.
-
.rbx? ⇒ true, false
(also: rubinius?)
readonly
Whether the interpreter is the Rubinius Interpreter.
-
.ree? ⇒ true, false
(also: enterprise?)
readonly
Whether the interpreter is the Ruby Enterprise Edition.
Class Method Summary collapse
-
.is?(what) ⇒ true, false
Whether the interpreter is the given identifier.
Class Attribute Details
.cardinal? ⇒ true, false (readonly) Also known as: parrot?
Returns whether the interpreter is the Parrot based Cardinal interpreter.
32 |
# File 'lib/host-os/interpreter.rb', line 32 def cardinal? = (@id == :cardinal) |
.exe ⇒ String? (readonly)
Path name of current Ruby executable.
87 |
# File 'lib/host-os/interpreter.rb', line 87 def exe = (defined?(@exe) ? @exe : @exe = find_exe) |
.id ⇒ Symbol (readonly)
Returns interpreter identifier.
|
|
# File 'lib/host-os/interpreter.rb', line 89
|
.jit_enabled? ⇒ true, false (readonly)
Returns whether the interpreter currently uses a JIT Compiler.
56 |
# File 'lib/host-os/interpreter.rb', line 56 def jit_enabled? = (jit_type != :none) |
.jit_modules ⇒ Array<Module> (readonly)
Returns available JIT Modules.
66 |
# File 'lib/host-os/interpreter.rb', line 66 def jit_modules = (@jit_modules ||= find_jit_modules) |
.jit_type ⇒ :java, ... (readonly)
Returns type of currently used JIT Compiler.
61 |
# File 'lib/host-os/interpreter.rb', line 61 def jit_type = (@jit_type ||= find_jit_type) |
.jruby? ⇒ true, false (readonly) Also known as: java?
Returns whether the interpreter is the Java based JRuby Interpreter.
38 |
# File 'lib/host-os/interpreter.rb', line 38 def jruby? = (@id == :jruby) |
.mri? ⇒ true, false (readonly) Also known as: cruby?, default?
Returns whether the interpreter is the Yukihiro Matsumoto's C-based (default) Ruby Interpreter.
25 |
# File 'lib/host-os/interpreter.rb', line 25 def mri? = (@id == :mri) |
.rbx? ⇒ true, false (readonly) Also known as: rubinius?
Returns whether the interpreter is the Rubinius Interpreter.
44 |
# File 'lib/host-os/interpreter.rb', line 44 def rbx? = (@id == :rbx) |
.ree? ⇒ true, false (readonly) Also known as: enterprise?
Returns whether the interpreter is the Ruby Enterprise Edition.
50 |
# File 'lib/host-os/interpreter.rb', line 50 def ree? = (@id == :ree) |
Class Method Details
.is?(what) ⇒ true, false
Returns whether the interpreter is the given identifier.
|
|
# File 'lib/host-os/interpreter.rb', line 92
|