aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/audit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index f8db07c94..7d70ad053 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -78,6 +78,8 @@ class FormulaAuditor
swig
]
+ FILEUTILS_METHODS = FileUtils.singleton_methods(false).join "|"
+
def initialize(formula, options={})
@formula = formula
@strict = !!options[:strict]
@@ -534,6 +536,12 @@ class FormulaAuditor
if line =~ /(Dir\[("[^\*{},]+")\])/
problem "#{$1} is unnecessary; just use #{$2}"
end
+
+ if line =~ /system (["'](#{FILEUTILS_METHODS}))["' ]/
+ system = $1
+ method = $2
+ problem "Use the `#{method}` Ruby method instead of `system #{system}`"
+ end
end
def audit_conditional_dep(dep, condition, line)