diff options
| -rw-r--r-- | Library/Homebrew/tap.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 2e9b98808..d5678c1a8 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -152,10 +152,15 @@ class Tap remote.casecmp("https://github.com/#{user}/homebrew-#{repo}") != 0 end + # path to the directory of all {Formula} files for this {Tap}. + def formula_dir + @formula_dir ||= [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?) + end + # an array of all {Formula} files of this {Tap}. def formula_files - @formula_files ||= if dir = [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?) - dir.children.select { |p| p.extname == ".rb" } + @formula_files ||= if formula_dir + formula_dir.children.select { |p| p.extname == ".rb" } else [] end |
