Module: Antrapol::ToolRack::RuntimeUtils

Defined in:
lib/toolrack/runtime_utils.rb

Class Method Summary collapse

Class Method Details

.on_jruby?Boolean Also known as: on_java?

Returns:

  • (Boolean)


27
28
29
# File 'lib/toolrack/runtime_utils.rb', line 27

def RuntimeUtils.on_jruby?
  (RUBY_PLATFORM =~ /java/) != nil
end

.on_linux?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/toolrack/runtime_utils.rb', line 15

def RuntimeUtils.on_linux?
  (RbConfig::CONFIG['host_os'] =~ /linux/) != nil
end

.on_mac?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/toolrack/runtime_utils.rb', line 11

def RuntimeUtils.on_mac?
  (RbConfig::CONFIG['host_os'] =~ /darwin|mac/) != nil
end

.on_ruby?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/toolrack/runtime_utils.rb', line 23

def RuntimeUtils.on_ruby?
  not on_jruby? 
end

.on_windows?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/toolrack/runtime_utils.rb', line 7

def RuntimeUtils.on_windows?
  (RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/) != nil
end

.os_stringObject



19
20
21
# File 'lib/toolrack/runtime_utils.rb', line 19

def RuntimeUtils.os_string
  RbConfig::CONFIG['host_os']
end