Class: Aruba::Platforms::WindowsWhich::AbsoluteOrRelativePathWhich
- Inherits:
-
Object
- Object
- Aruba::Platforms::WindowsWhich::AbsoluteOrRelativePathWhich
- Defined in:
- lib/aruba/platforms/windows_which.rb
Overview
Find path for absolute or relative command
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.match?(program) ⇒ Boolean
24 25 26 |
# File 'lib/aruba/platforms/windows_which.rb', line 24 def self.match?(program) Aruba.platform.absolute_path?(program) || Aruba.platform.relative_command?(program) end |
Instance Method Details
#call(program, _path) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/aruba/platforms/windows_which.rb', line 28 def call(program, _path) # Expand `#path_exts` found = Dir[program].first return File.(found) if found && Aruba.platform.executable?(found) nil end |