Yield absolute paths from find_formula

This commit is contained in:
Jack Nagel 2014-04-25 18:58:16 -05:00
parent b40a3413e3
commit bdee729a41
5 changed files with 10 additions and 10 deletions

View File

@ -32,8 +32,8 @@ module Homebrew extend self
if tap_dir.directory?
result = ""
if query
tap_dir.find_formula do |child|
basename = child.basename(".rb").to_s
tap_dir.find_formula do |file|
basename = file.basename(".rb").to_s
result = basename if basename == query
end
end

View File

@ -25,7 +25,7 @@ module Homebrew extend self
abort unless system "git clone https://github.com/#{repouser}/homebrew-#{repo} #{tapd}"
files = []
tapd.find_formula { |file| files << tapd.join(file) }
tapd.find_formula { |file| files << file }
link_tap_formula(files)
puts "Tapped #{files.length} formula"
@ -85,7 +85,7 @@ module Homebrew extend self
# check symlinks are all set in each tap
each_tap do |user, repo|
files = []
repo.find_formula { |file| files << repo.join(file) }
repo.find_formula { |file| files << file }
count += link_tap_formula(files)
end

View File

@ -18,7 +18,7 @@ module Homebrew extend self
raise "No such tap!" unless tapd.directory?
files = []
tapd.find_formula { |file| files << tapd.join(file) }
tapd.find_formula { |file| files << file }
unlink_tap_formula(files)
tapd.rmtree
tapd.dirname.rmdir_if_possible

View File

@ -321,8 +321,8 @@ class Pathname
def find_formula
[self/:Formula, self/:HomebrewFormula, self].each do |d|
if d.exist?
d.children.map{ |child| child.relative_path_from(self) }.each do |pn|
yield pn if pn.to_s =~ /.rb$/
d.children.each do |pn|
yield pn if pn.extname == ".rb"
end
break
end

View File

@ -163,9 +163,9 @@ class Formulary
path = tap.join("#{name}.rb")
if tap.directory?
tap.find_formula do |child|
if child.basename(".rb").to_s == name
path = tap.join(child)
tap.find_formula do |file|
if file.basename(".rb").to_s == name
path = file
end
end
end