
For consistency with `brew command` and the logic in `brew.sh` (both use `which` to find/validate an external command), we need to filter files that are not executable. Otherwise `brew commands` and thus bash completion will offer commands that will produce an error when attempting to use them. Closes Homebrew/homebrew#44999. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Homebrew's Formula API
This is the (partially) documented public API for Homebrew. It's currently a work in progress. Sorry about that!
The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.
You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.
Good luck!