add Tap#formula_dir
This commit is contained in:
parent
89bd945bb7
commit
327286cdfb
@ -152,10 +152,15 @@ class Tap
|
|||||||
remote.casecmp("https://github.com/#{user}/homebrew-#{repo}") != 0
|
remote.casecmp("https://github.com/#{user}/homebrew-#{repo}") != 0
|
||||||
end
|
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}.
|
# an array of all {Formula} files of this {Tap}.
|
||||||
def formula_files
|
def formula_files
|
||||||
@formula_files ||= if dir = [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?)
|
@formula_files ||= if formula_dir
|
||||||
dir.children.select { |p| p.extname == ".rb" }
|
formula_dir.children.select { |p| p.extname == ".rb" }
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user