Module: OS
- Defined in:
- lib/systemstats/os_detect.rb
Class Method Summary collapse
-
.is?(what) ⇒ Boolean
(also: is)
Detects the current OS running.
-
.linux? ⇒ Boolean
Returns true if operating system is Linux.
-
.mac? ⇒ Boolean
Returns true if Operating system is OsX.
- .to_s ⇒ Object
Class Method Details
.is?(what) ⇒ Boolean Also known as: is
Detects the current OS running
7 8 9 |
# File 'lib/systemstats/os_detect.rb', line 7 def is?(what) what === RbConfig::CONFIG['host_os'] end |
.linux? ⇒ Boolean
Returns true if operating system is Linux
20 21 22 |
# File 'lib/systemstats/os_detect.rb', line 20 def linux? OS.is? /linux|cygwin/ end |
.mac? ⇒ Boolean
Returns true if Operating system is OsX
25 26 27 |
# File 'lib/systemstats/os_detect.rb', line 25 def mac? OS.is? /mac|darwin/ end |
.to_s ⇒ Object
12 13 14 |
# File 'lib/systemstats/os_detect.rb', line 12 def to_s RbConfig::CONFIG['host_os'] end |