aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2014-04-25 18:58:16 -0500
committerJack Nagel2014-04-25 18:58:16 -0500
commit35fb78a1c82b6ca3f8cbfd63a8ba4e5d70fdb3ae (patch)
treee6b1f24f64f202d02811ffff26ebf8581f1d71ca /Library/Homebrew
parent52988fb6350c351323cc77e99577eca9bf955e57 (diff)
downloadhomebrew-35fb78a1c82b6ca3f8cbfd63a8ba4e5d70fdb3ae.tar.bz2
Yield absolute paths from find_formula
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/search.rb4
-rw-r--r--Library/Homebrew/cmd/tap.rb4
-rw-r--r--Library/Homebrew/cmd/untap.rb2
-rw-r--r--Library/Homebrew/extend/pathname.rb4
-rw-r--r--Library/Homebrew/formulary.rb6
5 files changed, 10 insertions, 10 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 991ca58b8..f729937f1 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -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
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index 0c15b4ac5..15ebacb61 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -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
diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb
index bbb223238..bba10b07a 100644
--- a/Library/Homebrew/cmd/untap.rb
+++ b/Library/Homebrew/cmd/untap.rb
@@ -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
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 9bd1275fd..c11775507 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -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
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index bde6188d6..ec4693785 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -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