Method: System::Ruby.name

Defined in:
lib/system/ruby.rb

.nameSymbol

Return the current Ruby interpreter’s name.

Examples:

Return OS name

System::OS.name # => :osx

Assert current OS

System::OS.name == System::OS::OSX # => true

Returns:

  • (Symbol)

    The name of the operating system.

Since:

  • 0.1.3



196
197
198
199
200
201
202
203
204
205
206
# File 'lib/system/ruby.rb', line 196

def name
  @name ||= if !OS.windows? && ruby?
    MRI
  elsif ruby? && engine? && engine == 'rbx'
    Rubinius
  elsif ruby? && engine? && engine == 'maglev'
    MagLev
  elsif engine? && engine == 'jruby'
    JRuby
  end
end