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.
This commit is contained in:
parent
e6cb8cbee9
commit
4c02b2276b
@ -318,16 +318,33 @@ class Pathname
|
|||||||
system '/usr/bin/install-info', '--delete', '--quiet', self.to_s, (self.dirname+'dir').to_s
|
system '/usr/bin/install-info', '--delete', '--quiet', self.to_s, (self.dirname+'dir').to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_formula pwd = self
|
def all_formula pwd = self
|
||||||
children.map{ |child| child.relative_path_from(pwd) }.each do |pn|
|
children.map{ |child| child.relative_path_from(pwd) }.each do |pn|
|
||||||
yield pn if pn.to_s =~ /.rb$/
|
yield pn if pn.to_s =~ /.rb$/
|
||||||
end
|
end
|
||||||
children.each do |child|
|
children.each do |child|
|
||||||
child.find_formula(pwd) do |pn|
|
child.all_formula(pwd) do |pn|
|
||||||
yield pn
|
yield pn
|
||||||
end if child.directory?
|
end if child.directory?
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
# sets $n and $d so you can observe creation of stuff
|
# sets $n and $d so you can observe creation of stuff
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user