Class: Terrapin::OSDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/terrapin/os_detector.rb

Instance Method Summary collapse

Instance Method Details

#archObject


21
22
23
# File 'lib/terrapin/os_detector.rb', line 21

def arch
  RUBY_PLATFORM
end

#java?Boolean

Returns:

  • (Boolean)

5
6
7
# File 'lib/terrapin/os_detector.rb', line 5

def java?
  arch =~ /java/
end

#path_separatorObject


17
18
19
# File 'lib/terrapin/os_detector.rb', line 17

def path_separator
  File::PATH_SEPARATOR
end

#unix?Boolean

Returns:

  • (Boolean)

9
10
11
# File 'lib/terrapin/os_detector.rb', line 9

def unix?
  RbConfig::CONFIG['host_os'] !~ /mswin|mingw/
end

#windows?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'lib/terrapin/os_detector.rb', line 13

def windows?
  !unix?
end