Class: TTY::System
- Inherits:
-
Object
- Object
- TTY::System
- Defined in:
- lib/tty/system.rb,
lib/tty/system/which.rb
Defined Under Namespace
Classes: Which
Class Method Summary collapse
-
.unix? ⇒ Boolean
Check if unix platform.
-
.which(command) ⇒ Object
Find an executable in the PATH.
-
.windows? ⇒ Boolean
Check if windows platform.
Class Method Details
.unix? ⇒ Boolean
Check if unix platform
24 25 26 |
# File 'lib/tty/system.rb', line 24 def unix? RbConfig::CONFIG['host_os'] =~ /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i end |
.which(command) ⇒ Object
Find an executable in the PATH
33 34 35 |
# File 'lib/tty/system.rb', line 33 def which(command) Which.new(command) end |
.windows? ⇒ Boolean
Check if windows platform.
15 16 17 |
# File 'lib/tty/system.rb', line 15 def windows? RbConfig::CONFIG['host_os'] =~ /msdos|mswin|djgpp|mingw|windows/ end |