Module: Ohai::Mixin::OS

Included in:
DSL::Plugin
Defined in:
lib/ohai/mixin/os.rb

Class Method Summary collapse

Class Method Details

.collect_osObject


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/ohai/mixin/os.rb', line 26

def collect_os
  case ::RbConfig::CONFIG['host_os']
  when /aix(.+)$/
    return "aix"
  when /darwin(.+)$/
    return "darwin"
  when /hpux(.+)$/
    return "hpux"
  when /linux/
    return "linux"
  when /freebsd(.+)$/
    return "freebsd"
  when /openbsd(.+)$/
    return "openbsd"
  when /netbsd(.*)$/
    return "netbsd"
  when /solaris2/
    return "solaris2"
  when /mswin|mingw32|windows/
    # After long discussion in IRC the "powers that be" have come to a consensus
    # that no Windows platform exists that was not based on the
    # Windows_NT kernel, so we herby decree that "windows" will refer to all
    # platforms built upon the Windows_NT kernel and have access to win32 or win64
    # subsystems.
    return "windows"
  else
    return ::RbConfig::CONFIG['host_os']
  end
end