Module: OS

Defined in:
lib/exceltocsv/os.rb

Overview

File

os.rb

Purpose

Operating System detecting

Author

Jeff McAffee 06/03/2014

Copyright

Copyright © 2014, kTech Systems LLC. All rights reserved.

Website

ktechsystems.com

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/exceltocsv/os.rb', line 23

def OS.linux?
  OS.unix? and not OS.mac?
end

.mac?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/exceltocsv/os.rb', line 15

def OS.mac?
 (/darwin/ =~ RbConfig::CONFIG["arch"]) != nil
end

.unix?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/exceltocsv/os.rb', line 19

def OS.unix?
  !OS.windows?
end

.windows?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/exceltocsv/os.rb', line 11

def OS.windows?
  (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RbConfig::CONFIG["arch"]) != nil
end