Module: Monkey::Engine

Includes:
Rubinius
Included in:
Monkey, Monkey
Defined in:
lib/monkey/engine.rb

Overview

Makes sure we always have RUBY_ENGINE, RUBY_ENGINE_VERSION and RUBY_DESCRIPTION

Class Method Summary collapse

Class Method Details

.ironruby?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/monkey/engine.rb', line 61

def ironruby?
  RUBY_ENGINE == "ironruby"
end

.jruby?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/monkey/engine.rb', line 41

def jruby?
  RUBY_ENGINE == "jruby"
end

.macruby?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/monkey/engine.rb', line 67

def macruby?
  RUBY_ENGINE == "macruby"
end

.mri?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/monkey/engine.rb', line 47

def mri?
  RUBY_ENGINE == "ruby"
end

.rbx?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/monkey/engine.rb', line 53

def rbx?
  RUBY_ENGINE == "rbx"
end

.rubinius?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/monkey/engine.rb', line 57

def rbx?
  RUBY_ENGINE == "rbx"
end

.ruby_engine(pretty = true) ⇒ Object



73
74
75
76
77
78
79
80
# File 'lib/monkey/engine.rb', line 73

def ruby_engine(pretty = true)
  return RUBY_ENGINE unless pretty
  case RUBY_ENGINE
  when "ruby"  then "CRuby"
  when "rbx"   then "Rubinius"
  when /ruby$/ then RUBY_ENGINE.capitalize.gsub("ruby", "Ruby")
  end
end