You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a pre-requisite for #2. I may want to also be able to supply a PATH-like string manually instead of relying on ENV['PATH']
# Analog of Windows `where` command, or a `which` that finds *all*# matching executables on the supplied path.# @param cmd [String] - the command to find# @return [Enumerable<String>] - the executables found, lazily.deffind_executables(cmd)returnenum_for(:find_executables,cmd)unlessblock_given?exts=ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']ENV['PATH'].split(File::PATH_SEPARATOR).eachdo |path|
exts.eachdo |ext|
exe=File.join(path,"#{cmd}#{ext}")yieldexeifFile.executable?exeendendend
The text was updated successfully, but these errors were encountered:
This is a pre-requisite for #2. I may want to also be able to supply a
PATH
-like string manually instead of relying onENV['PATH']
The text was updated successfully, but these errors were encountered: