Class: Train::Extras::OSCommon
- Inherits:
-
Object
- Object
- Train::Extras::OSCommon
- Includes:
- DetectDarwin, DetectEsx, DetectLinux, DetectUnix, DetectWindows
- Defined in:
- lib/train/extras/os_common.rb
Constant Summary collapse
- OS =
rubocop:disable Style/MutableConstant
{ # rubocop:disable Style/MutableConstant 'redhat' => %w{ redhat oracle centos fedora amazon scientific xenserver wrlinux }, 'debian' => %w{ debian ubuntu linuxmint raspbian }, 'suse' => %w{ suse opensuse }, 'bsd' => %w{ freebsd netbsd openbsd darwin }, 'solaris' => %w{ solaris smartos omnios openindiana opensolaris nexentacore }, 'windows' => %w{ windows }, 'aix' => %w{ aix }, 'hpux' => %w{ hpux }, 'esx' => %w{ esx }, }
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(backend, platform = nil) ⇒ OSCommon
constructor
A new instance of OSCommon.
- #to_hash ⇒ Object
Methods included from DetectEsx
Methods included from DetectWindows
Methods included from DetectUnix
#detect_solaris, #detect_via_uname
Methods included from DetectLinux
#detect_linux, #detect_linux_via_config, #fetch_os_release, #parse_os_release_info, #redhatish_platform, #redhatish_version, #uname_r, #uname_s
Methods included from LinuxLSB
#detect_linux_via_lsb, #lsb, #lsb_config, #lsb_release
Methods included from DetectDarwin
Constructor Details
#initialize(backend, platform = nil) ⇒ OSCommon
Returns a new instance of OSCommon.
25 26 27 28 29 |
# File 'lib/train/extras/os_common.rb', line 25 def initialize(backend, platform = nil) @backend = backend @platform = platform || {} detect_family end |
Instance Method Details
#[](key) ⇒ Object
31 32 33 |
# File 'lib/train/extras/os_common.rb', line 31 def [](key) @platform[key] end |
#to_hash ⇒ Object
35 36 37 |
# File 'lib/train/extras/os_common.rb', line 35 def to_hash @platform end |