Class: TTY::System

Inherits:
Object
  • Object
show all
Defined in:
lib/tty/system.rb

Class Method Summary collapse

Class Method Details

.unix?Boolean

Check if unix platform

Returns:

  • (Boolean)


24
25
26
# File 'lib/tty/system.rb', line 24

def unix?
  RbConfig::CONFIG['host_os'] =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
end

.windows?Boolean

Check if windows platform.

Returns:

  • (Boolean)


15
16
17
# File 'lib/tty/system.rb', line 15

def windows?
  RbConfig::CONFIG['host_os'] =~ /msdos|mswin|djgpp|mingw|windows/
end