class CHECKING::YOU::OUT::XROSS_INFECTION::SYSTEM

Host operating system detection.

Constants

CHAIN

I used to check `RUBY_PLATFORM` alone until I learned about `RbConfig`: idiosyncratic-ruby.com/42-ruby-config.html

Public Class Methods

BSD?() click to toggle source
# File lib/checking-you-out/ghost_revival/xross_infection.rb, line 60
def self.BSD?
  (self::CHAIN =~ /bsd/i) != nil
end
Lunix?() click to toggle source
# File lib/checking-you-out/ghost_revival/xross_infection.rb, line 64
def self.Lunix?
  # LUNIX TRULY IS THE SUPERIOR OPERATING SYSTEM!!!1
  # http://www.somethingawful.com/jeffk/usar.swf
  (self::CHAIN =~ /linux/i) != nil
end
OS∕2?() click to toggle source
# File lib/checking-you-out/ghost_revival/xross_infection.rb, line 49
def self.OS∕2?
  # This could also be DOS, but I'll assume OS/2:
  # http://emx.sourceforge.net/
  # http://www.os2ezine.com/20020716/page_7.html
  (self::CHAIN =~ /emx/i) != nil
end
Windows?() click to toggle source

This is kinda redundant with `Gem.win_platform?`: github.com/rubygems/rubygems/blob/master/lib/rubygems.rb Ctrl+F 'WIN_PATTERNS'

# File lib/checking-you-out/ghost_revival/xross_infection.rb, line 35
def self.Windows?
  (self::CHAIN =~ %r&
    mswin|    # MS VC compiler / MS VC runtime
    mingw|    # GNU compiler  / MS VC runtime
    cygwin|   # GNU compiler / Cygwin POSIX runtime
    interix|  # GNU compiler / MS POSIX runtime
    bccwin|   # Borland C++ compiler and runtime (dead since Embarcadero C++ Builder uses Clang)
    windows|  # e.g. `ENV['OS']` can be `'Windows_NT'`
    wince|    # Can Ruby even run on CE? idk
    djgpp|    # http://www.delorie.com/djgpp/
    winders   # lol
  &xi) != nil || Gem.win_platform?
end
macOS?() click to toggle source
# File lib/checking-you-out/ghost_revival/xross_infection.rb, line 56
def self.macOS?
  (self::CHAIN =~ /darwin/i) != nil
end