diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index dfb0355df2..afe6167b61 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -195,7 +195,7 @@ class FormulaAuditor urls = [(f.stable.url rescue nil), (f.devel.url rescue nil), (f.head.url rescue nil)].compact # Check GNU urls; doesn't apply to mirrors - urls.select { |u| u =~ %r[^(https?|ftp)://(?!alpha).+/gnu/] }.each do |u| + urls.grep(%r[^(https?|ftp)://(?!alpha).+/gnu/]).each do |u| problem "\"ftpmirror.gnu.org\" is preferred for GNU software (url is #{u})." end @@ -230,12 +230,12 @@ class FormulaAuditor end # Check for git:// GitHub repo urls, https:// is preferred. - urls.select { |u| u =~ %r[^git://([^/])*github\.com/] }.each do |u| + urls.grep(%r[^git://([^/])*github\.com/]).each do |u| problem "Use https:// URLs for accessing GitHub repositories (url is #{u})." end # Check for http:// GitHub repo urls, https:// is preferred. - urls.select { |u| u =~ %r[^http://github\.com/.*\.git$] }.each do |u| + urls.grep(%r[^http://github\.com/.*\.git$]).each do |u| problem "Use https:// URLs for accessing GitHub repositories (url is #{u})." end diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index a0ac89026f..a80fd78ede 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -1095,7 +1095,7 @@ module Homebrew extend self checks = Checks.new if ARGV.include? '--list-checks' - checks.methods.select { |m| m =~ /^check_/ }.sort.each { |m| puts m } + checks.methods.grep(/^check_/).sort.each { |m| puts m } exit end @@ -1106,7 +1106,7 @@ module Homebrew extend self checks.methods.sort << "check_for_linked_keg_only_brews" << "check_for_outdated_homebrew" else ARGV.named - end.select{ |method| method =~ /^check_/ }.reverse.uniq.reverse + end.grep(/^check_/).reverse.uniq.reverse first_warning = true methods.each do |method|