diff options
| author | Max Howell | 2012-03-16 17:24:46 +0000 |
|---|---|---|
| committer | Max Howell | 2012-03-16 21:06:17 +0000 |
| commit | e613cbe5783cea2abb8100b56c22126a1ab6b9f2 (patch) | |
| tree | cc57863bafc9233b9c552a60441ce2ab16587787 /Library/Homebrew/extend | |
| parent | fa215d34e91d9271debd2e4418562adabbb19eb8 (diff) | |
| download | homebrew-e613cbe5783cea2abb8100b56c22126a1ab6b9f2.tar.bz2 | |
Taps can only have one directory of formula
Rationale: Let's not have duplicate-names. Insisting on only one directory lets the filesystem enforce this unique-naming criteria for us.
We special-case adamv/alt for now, until we remove it.
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index da195e5a8..8465408fe 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -318,16 +318,33 @@ class Pathname system '/usr/bin/install-info', '--delete', '--quiet', self.to_s, (self.dirname+'dir').to_s end - def find_formula pwd = self + def all_formula pwd = self children.map{ |child| child.relative_path_from(pwd) }.each do |pn| yield pn if pn.to_s =~ /.rb$/ end children.each do |child| - child.find_formula(pwd) do |pn| + child.all_formula(pwd) do |pn| yield pn end if child.directory? end end + + def find_formula + # remove special casing once tap is established and alt removed + if self == HOMEBREW_LIBRARY/"Taps/adamv-alt" + all_formula do |file| + yield file + end + return + end + + [self/:Formula, self/:HomebrewFormula, self].each do |d| + d.children.map{ |child| child.relative_path_from(self) }.each do |pn| + yield pn if pn.to_s =~ /.rb$/ + break + end if d.exist? + end + end end # sets $n and $d so you can observe creation of stuff |
