Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'no_output_option'
Browse files Browse the repository at this point in the history
  • Loading branch information
oreoshake committed Dec 22, 2012
2 parents 7aeac11 + e622f51 commit 843323d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1 +1 @@
Gemfile.lock
Gemfile.locktmp/rspec_guard_result
13 changes: 7 additions & 6 deletions lib/guard/brakeman.rb
Expand Up @@ -29,8 +29,9 @@ def initialize(watchers = [], options = { })
:notifications => true,
:run_on_start => false,
:chatty => false,
:min_confidence => 1
}.update(options)
:min_confidence => 1,
:quiet => true
}.merge!(options)
end

# Gets called once when Guard starts.
Expand Down Expand Up @@ -67,7 +68,7 @@ def run_all
def run_on_changes paths
return run_all unless @tracker.checks

UI.info "\n\nrescanning #{paths}, running all checks"
info "\n\nrescanning #{paths}, running all checks"
report = ::Brakeman::rescan(@tracker, paths)
print_changed(report)
throw :task_has_failed if report.any_warnings?
Expand All @@ -76,7 +77,7 @@ def run_on_changes paths
private

def print_failed report
UI.info "\n------ brakeman warnings --------\n"
info "\n------ brakeman warnings --------\n"

icon = report.all_warnings.count > 0 ? :failed : :success

Expand All @@ -98,7 +99,7 @@ def print_failed report
end

def print_changed report
UI.info "\n------ brakeman warnings --------\n"
info "\n------ brakeman warnings --------\n"

message = []
should_alert = false
Expand Down Expand Up @@ -169,7 +170,7 @@ def pluralize(count, singular, plural = nil)
end

def info(message, color = :white)
UI.info(UI.send(:color, message, color))
UI.info(UI.send(:color, message, color)) unless @options[:quiet]
end

def warning_info(warnings, color = :white)
Expand Down
2 changes: 1 addition & 1 deletion tmp/aruba/default_app/Guardfile
@@ -1,4 +1,4 @@
guard 'brakeman', :chatty => false,:notifications => true, :run_on_start => true, :min_confidence => 0 do
guard 'brakeman', :chatty => false,:notifications => true, :run_on_start => true, :min_confidence => 0, :quiet => false do
watch(%r{^app/.+\.(erb|haml|rhtml|rb)$})
watch(%r{^config/.+\.rb$})
watch(%r{^lib/.+\.rb$})
Expand Down
1 change: 1 addition & 0 deletions tmp/rspec_guard_result
@@ -0,0 +1 @@

0 comments on commit 843323d

Please sign in to comment.