From b6d36bbab1f55372f5a06508bc470fc7b0cdca72 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 8 Sep 2010 09:07:59 -0700 Subject: brew-audit - check inreplace block var name --- Library/Contributions/examples/brew-audit.rb | 5 +++++ Library/Formula/avanor.rb | 6 +++--- Library/Formula/fortune.rb | 14 +++++++------- Library/Formula/pbrt.rb | 24 ++++++++++++------------ Library/Formula/rabbitmq.rb | 8 ++++---- Library/Formula/ssss.rb | 11 ++++------- Library/Formula/tmux.rb | 6 +++--- 7 files changed, 38 insertions(+), 36 deletions(-) (limited to 'Library') diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb index b9c36e00b..4d2c08e26 100755 --- a/Library/Contributions/examples/brew-audit.rb +++ b/Library/Contributions/examples/brew-audit.rb @@ -29,6 +29,11 @@ def audit_formula_text text problems << " * Don't need 'FileUtils.' before #{$1}." end + # Check for long inreplace block vars + if text =~ /inreplace .* do \|(.{2,})\|/ + problems << " * \"inreplace do |s|\" is preferred over \"|#{$1}|\"." + end + # Check for string interpolation of single values. if text =~ /(system|inreplace|gsub!|change_make_var!) .* ['"]#\{(\w+)\}['"]/ problems << " * Don't need to interpolate \"#{$2}\" with #{$1}" diff --git a/Library/Formula/avanor.rb b/Library/Formula/avanor.rb index 741b71239..1cd24637f 100644 --- a/Library/Formula/avanor.rb +++ b/Library/Formula/avanor.rb @@ -6,9 +6,9 @@ class Avanor