aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/update.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-26 20:11:53 -0500
committerJack Nagel2014-07-26 20:11:53 -0500
commit5d6efe9957e5b2360b30eca6664724e65e937fa9 (patch)
tree1b9545b0b2cce764efe945a281fd0b86dfafd498 /Library/Homebrew/cmd/update.rb
parenta3ad8405f644870e0dfa3a69e22a23300048fffd (diff)
downloadhomebrew-5d6efe9957e5b2360b30eca6664724e65e937fa9.tar.bz2
Remove obsolete hacks from updater report
Diffstat (limited to 'Library/Homebrew/cmd/update.rb')
-rw-r--r--Library/Homebrew/cmd/update.rb28
1 files changed, 5 insertions, 23 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index ccb458e32..5e7f34b62 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -254,25 +254,7 @@ class Report
end
def tapped_formula_for key
- fetch(key, []).select do |path|
- case path.to_s
- when HOMEBREW_TAP_PATH_REGEX
- valid_formula_location?("#{$1}/#{$2}/#{$3}")
- else
- false
- end
- end.compact
- end
-
- def valid_formula_location?(relative_path)
- parts = relative_path.split('/')[2..-1]
- return false unless File.extname(parts.last) == ".rb"
- case parts.first
- when "Formula", "HomebrewFormula"
- parts.length == 2
- else
- parts.length == 1
- end
+ fetch(key, []).select { |path| HOMEBREW_TAP_PATH_REGEX === path.to_s }
end
def new_tapped_formula
@@ -286,19 +268,19 @@ class Report
def select_formula key
fetch(key, []).map do |path|
case path.to_s
- when %r{^#{Regexp.escape(HOMEBREW_LIBRARY.to_s)}/Formula}o
- path.basename(".rb").to_s
when HOMEBREW_TAP_PATH_REGEX
"#{$1}/#{$2.sub("homebrew-", "")}/#{path.basename(".rb")}"
+ else
+ path.basename(".rb").to_s
end
- end.compact.sort
+ end.sort
end
def dump_formula_report key, title
formula = select_formula(key)
unless formula.empty?
ohai title
- puts_columns formula.uniq
+ puts_columns formula
end
end
end