Class: BinaryChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/shell/binary_checker.rb

Instance Method Summary collapse

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

Returns:

  • (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