Module: Hoodie::OS
Overview
Finds out the current Operating System.
Instance Method Summary collapse
-
#linux? ⇒ Boolean
Returns true if OS is Linux.
-
#mac? ⇒ Boolean
Returns true if OS is Mac.
-
#unix? ⇒ Boolean
Returns true if OS is Unix.
-
#windows? ⇒ Boolean
Returns true if OS is Windows.
Instance Method Details
#linux? ⇒ Boolean
Returns true if OS is Linux.
51 52 53 54 |
# File 'lib/hoodie/utils/os.rb', line 51 def linux? linux = /linux/i (RbConfig::CONFIG['host_os'] =~ linux) != nil end |
#mac? ⇒ Boolean
Returns true if OS is Mac.
37 38 39 40 |
# File 'lib/hoodie/utils/os.rb', line 37 def mac? mac = /darwin|mac os/i (RbConfig::CONFIG['host_os'] =~ mac) != nil end |
#unix? ⇒ Boolean
Returns true if OS is Unix.
44 45 46 47 |
# File 'lib/hoodie/utils/os.rb', line 44 def unix? unix = /solaris|bsd/i (RbConfig::CONFIG['host_os'] =~ unix) != nil end |
#windows? ⇒ Boolean
Returns true if OS is Windows.
30 31 32 33 |
# File 'lib/hoodie/utils/os.rb', line 30 def windows? windows = /cygwin|mswin|mingw|bccwin|wince|emx/i (RbConfig::CONFIG['host_os'] =~ windows) != nil end |