From 49e74ac1cc279e3aba2fc6299e8b3daaa9c854ca Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Fri, 24 Feb 2012 09:43:19 -0800 Subject: [PATCH] Brakeman.run should always return a Tracker instead of returning false for options[:exit_on_warn] --- bin/brakeman | 4 ++-- lib/brakeman.rb | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/brakeman b/bin/brakeman index c12443f1..c85c7cc2 100755 --- a/bin/brakeman +++ b/bin/brakeman @@ -42,9 +42,9 @@ unless options[:app_path] end #Run scan and output a report -clean = Brakeman.run options.merge(:print_report => true, :quiet => options[:quiet]) +tracker = Brakeman.run options.merge(:print_report => true, :quiet => options[:quiet]) #Return error code if --exit-on-warn is used and warnings were found -if options[:exit_on_warn] and not clean +if options[:exit_on_warn] and not tracker.checks.all_warnings.empty? exit Brakeman::Warnings_Found_Exit_Code end diff --git a/lib/brakeman.rb b/lib/brakeman.rb index fccd4cca..94b12a16 100644 --- a/lib/brakeman.rb +++ b/lib/brakeman.rb @@ -262,10 +262,6 @@ module Brakeman puts tracker.report.send(options[:output_format]) end - if options[:exit_on_warn] and not tracker.checks.all_warnings.empty? - return false - end - tracker end -- GitLab