From d1f15e967b51ea9eb7538551ab39f4039b44239b Mon Sep 17 00:00:00 2001 From: Tsukasa OMOTO Date: Wed, 14 May 2014 16:43:52 +0900 Subject: Taps: cleanup regexps around Taps Closes Homebrew/homebrew#29139. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/update.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Library/Homebrew/cmd/update.rb') 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 -- cgit v1.2.3