Class: Aruba::Platforms::UnixWhich::AbsoluteOrRelativePathWhich

Inherits:
Object
  • Object
show all
Defined in:
lib/aruba/platforms/unix_which.rb

Overview

Find path for absolute or relative command

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.match?(program) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/aruba/platforms/unix_which.rb', line 22

def self.match?(program)
  Aruba.platform.absolute_path?(program) || Aruba.platform.relative_command?(program)
end

Instance Method Details

#call(program, _path) ⇒ Object



26
27
28
29
30
# File 'lib/aruba/platforms/unix_which.rb', line 26

def call(program, _path)
  return File.expand_path(program) if Aruba.platform.executable?(program)

  nil
end