aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cmd/update.rb')
-rw-r--r--Library/Homebrew/cmd/update.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 45f8251ba..88804c6cf 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -218,9 +218,9 @@ class Report < Hash
def tapped_formula_for key
fetch(key, []).select do |path|
- case path.relative_path_from(HOMEBREW_REPOSITORY).to_s
- when %r{^Library/Taps/([\w-]+/[\w-]+/.*)}
- valid_formula_location?($1)
+ case path.to_s
+ when HOMEBREW_TAP_PATH_REGEX
+ valid_formula_location?("#{$1}/#{$2}/#{$3}")
else
false
end
@@ -247,11 +247,11 @@ class Report < Hash
def select_formula key
fetch(key, []).map do |path|
- case path.relative_path_from(HOMEBREW_REPOSITORY).to_s
- when %r{^Library/Formula}
+ case path.to_s
+ when Regexp.new(HOMEBREW_LIBRARY + "/Formula")
path.basename(".rb").to_s
- when %r{^Library/Taps/([\w-]+)/(homebrew-)?([\w-]+)/(.*)\.rb}
- "#$1/#$3/#{path.basename(".rb")}"
+ when HOMEBREW_TAP_PATH_REGEX
+ "#$1/#{$2.sub("homebrew-", "")}/#{path.basename(".rb")}"
end
end.compact.sort
end