audit: improve FileUtils check.

Match the parens properly and only interpolate once.

Closes Homebrew/homebrew#35288.
Closes Homebrew/homebrew#35291.
This commit is contained in:
Mike McQuaid 2014-12-27 20:35:26 +00:00
parent 77a1c6f166
commit 13239276f0

View File

@ -548,7 +548,7 @@ class FormulaAuditor
problem "#{$1} is unnecessary; just use #{$2}"
end
if line =~ /system (["'](#{FILEUTILS_METHODS}))["' ]/
if line =~ /system (["'](#{FILEUTILS_METHODS})["' ])/o
system = $1
method = $2
problem "Use the `#{method}` Ruby method instead of `system #{system}`"