diff options
Diffstat (limited to 'Library/Homebrew/cmd/audit.rb')
| -rwxr-xr-x | Library/Homebrew/cmd/audit.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 4096ebff8..5580eaeeb 100755 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -206,33 +206,33 @@ def audit_formula_instance f end module Homebrew extend self -def audit - ff.each do |f| - problems = [] - problems += audit_formula_instance f - problems += audit_formula_urls f - - text = "" - File.open(f.path, "r") { |afile| text = afile.read } - - # DATA with no __END__ - if (text =~ /\bDATA\b/) and not (text =~ /^\s*__END__\s*$/) - problems << " * 'DATA' was found, but no '__END__'" - end + def audit + ff.each do |f| + problems = [] + problems += audit_formula_instance f + problems += audit_formula_urls f + + text = "" + File.open(f.path, "r") { |afile| text = afile.read } - problems += [' * invalid or missing version'] if f.version.to_s.empty? + # DATA with no __END__ + if (text =~ /\bDATA\b/) and not (text =~ /^\s*__END__\s*$/) + problems << " * 'DATA' was found, but no '__END__'" + end - # Don't try remaining audits on text in __END__ - text_without_patch = (text.split("__END__")[0]).strip() + problems += [' * invalid or missing version'] if f.version.to_s.empty? - problems += audit_formula_text(text_without_patch) - problems += audit_formula_options(f, text_without_patch) + # Don't try remaining audits on text in __END__ + text_without_patch = (text.split("__END__")[0]).strip() - unless problems.empty? - puts "#{f.name}:" - puts problems * "\n" - puts + problems += audit_formula_text(text_without_patch) + problems += audit_formula_options(f, text_without_patch) + + unless problems.empty? + puts "#{f.name}:" + puts problems * "\n" + puts + end end end end -end |
