aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorXu Cheng2015-12-02 14:35:42 +0800
committerXu Cheng2015-12-03 13:46:59 +0800
commit48950f2cc07d74a52411cf1fe8674409736291ab (patch)
tree0da3b69048aea7198636e5f1bd2df3902fc9258b /Library/Homebrew/formula.rb
parent9755662e49439c29d5724f5d71f3ba1f03cd9d6d (diff)
downloadbrew-48950f2cc07d74a52411cf1fe8674409736291ab.tar.bz2
centralize the logic of handling `homebrew-` in Tap.fetch
Closes Homebrew/homebrew#46537. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 92bb779f8..6de23f7b0 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -134,7 +134,7 @@ class Formula
@revision = self.class.revision || 0
if path.to_s =~ HOMEBREW_TAP_PATH_REGEX
- @full_name = "#{$1}/#{$2.gsub(/^homebrew-/, "")}/#{name}"
+ @full_name = "#{Tap.fetch($1, $2)}/#{name}"
else
@full_name = name
end
@@ -296,7 +296,7 @@ class Formula
end
elsif tap?
user, repo = tap.split("/")
- formula_renames = Tap.fetch(user, repo.sub("homebrew-", "")).formula_renames
+ formula_renames = Tap.fetch(user, repo).formula_renames
if formula_renames.value?(name)
formula_renames.to_a.rassoc(name).first
end
@@ -309,7 +309,7 @@ class Formula
Formula.core_alias_reverse_table[name] || []
elsif tap?
user, repo = tap.split("/")
- Tap.fetch(user, repo.sub("homebrew-", "")).alias_reverse_table[full_name] || []
+ Tap.fetch(user, repo).alias_reverse_table[full_name] || []
else
[]
end