Module: Running

Defined in:
lib/running.rb

Constant Summary collapse

WINDOWS =
RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!

Class Method Summary collapse

Class Method Details

.from_the_police?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/running.rb', line 58

def from_the_police?
  true
end

.jruby?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/running.rb', line 38

def jruby?
  !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "jruby"
end

.maglev?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/running.rb', line 34

def maglev?
  ruby? && !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "maglev"
end

.mingw?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/running.rb', line 46

def mingw?
  !WINDOWS.nil? && Gem::Platform.local.os == "mingw32"
end

.mingw_18?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/running.rb', line 50

def mingw_18?
  mingw? && RUBY_VERSION < "1.9"
end

.mingw_19?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/running.rb', line 54

def mingw_19?
  mingw? && RUBY_VERSION >= "1.9"
end

.mri?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/running.rb', line 18

def mri?
  !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
end

.mri_18?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/running.rb', line 22

def mri_18?
  mri? && RUBY_VERSION < "1.9"
end

.mri_19?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/running.rb', line 26

def mri_19?
  mri? && RUBY_VERSION >= "1.9"
end

.mswin?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/running.rb', line 42

def mswin?
  !WINDOWS.nil?
end

.rbx?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/running.rb', line 30

def rbx?
  ruby? && !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "rbx"
end

.ruby?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/running.rb', line 6

def ruby?
  !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev")
end

.ruby_18?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/running.rb', line 10

def ruby_18?
  ruby? && RUBY_VERSION < "1.9"
end

.ruby_19?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/running.rb', line 14

def ruby_19?
  ruby? && RUBY_VERSION >= "1.9"
end