Class: OSHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/javonet-ruby-sdk/utils/os_helper.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/javonet-ruby-sdk/utils/os_helper.rb', line 10

def self.linux?
  RbConfig::CONFIG['host_os'] =~ /linux/i
end

.mac?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/javonet-ruby-sdk/utils/os_helper.rb', line 6

def self.mac?
  RbConfig::CONFIG['host_os'] =~ /darwin/i
end

.os_nameObject



18
19
20
# File 'lib/javonet-ruby-sdk/utils/os_helper.rb', line 18

def self.os_name
  RbConfig::CONFIG['host_os']
end

.unix?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/javonet-ruby-sdk/utils/os_helper.rb', line 14

def self.unix?
  RbConfig::CONFIG['host_os'] =~ /unix/i
end

.windows?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/javonet-ruby-sdk/utils/os_helper.rb', line 2

def self.windows?
  RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/i
end