Class: BinaryChecker
- Inherits:
-
Object
- Object
- BinaryChecker
- Defined in:
- lib/shell/binary_checker.rb
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(command) ⇒ BinaryChecker
constructor
A new instance of BinaryChecker.
Constructor Details
#initialize(command) ⇒ BinaryChecker
Returns a new instance of BinaryChecker.
2 3 4 |
# File 'lib/shell/binary_checker.rb', line 2 def initialize(command) @command = command end |
Instance Method Details
#exist? ⇒ Boolean
6 7 8 9 10 |
# File 'lib/shell/binary_checker.rb', line 6 def exist? !!ENV['PATH'].split(':'). map {|folder| File.exists?(folder+'/'+@command)}. inject(false){|a,b| a || b } end |