Permalink
Browse files

audit: clean up some regexps

  • Loading branch information...
1 parent 7e04a9d commit 9fc3a6960e17fc5147976933c973e6695d0b4fbd @jacknagel jacknagel committed Apr 7, 2013
Showing with 5 additions and 4 deletions.
  1. +5 −4 Library/Homebrew/cmd/audit.rb
View
9 Library/Homebrew/cmd/audit.rb
@@ -430,16 +430,17 @@ def audit_text
problem "Use MacOS.version instead of MACOS_VERSION"
end
- if text =~ /(MacOS.((snow_)?leopard|leopard|(mountain_)?lion)\?)/
- problem "#{$1} is deprecated, use a comparison to MacOS.version instead"
+ cats = %w{leopard snow_leopard lion mountain_lion}.join("|")
+ if text =~ /MacOS\.(?:#{cats})\?/
+ problem "\"#{$&}\" is deprecated, use a comparison to MacOS.version instead"
end
if text =~ /skip_clean\s+:all/
problem "`skip_clean :all` is deprecated; brew no longer strips symbols"
end
- if text =~ /depends_on (.*)\.new$/
- problem "`depends_on` can take requirement classes directly"
+ if text =~ /depends_on [A-Z][\w:]+\.new$/
+ problem "`depends_on` can take requirement classes instead of instances"
end
end

0 comments on commit 9fc3a69

Please sign in to comment.