Method: Mixin::Shell#which
- Defined in:
- lib/fox/interface/thor/mixin/shell.rb
#which(command) ⇒ Boolean Also known as: exists?
Returns boolean true if command is available, false if not
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/fox/interface/thor/mixin/shell.rb', line 90 def which command result = false begin partial = command.to_s partial = partial.split(' ').first.to_s if( partial =~ %r{ }i ) path = File.which( partial ) result = true unless( path.nil? ) rescue Exception => e say "(EE) " + e., :red result = false end return result end |