Method: Doing::Util#first_available_exec
- Defined in:
- lib/doing/util.rb
#first_available_exec(*commands) ⇒ Object
Return the first valid executable from a list of commands
33 34 35 36 |
# File 'lib/doing/util.rb', line 33 def first_available_exec(*commands) commands.compact.map(&:strip).reject(&:empty?).uniq .find { |cmd| exec_available(cmd.split.first) } end |