Method: ChildProcess.os

Defined in:
lib/childprocess.rb

.osObject



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/childprocess.rb', line 77

def os
  return :windows if ENV['FAKE_WINDOWS'] == 'true'

  @os ||= (
    require "rbconfig"
    host_os = RbConfig::CONFIG['host_os'].downcase

    case host_os
    when /linux/
      :linux
    when /darwin|mac os/
      :macosx
    when /mswin|msys|mingw32/
      :windows
    when /cygwin/
      :cygwin
    when /solaris|sunos/
      :solaris
    when /bsd|dragonfly/
      :bsd
    when /aix/
      :aix
    else
      raise Error, "unknown os: #{host_os.inspect}"
    end
  )
end