guard-brakeman 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/guard/brakeman.rb +24 -3
  2. metadata +10 -7
@@ -36,9 +36,11 @@ module Guard
36
36
  # @raise [:task_has_failed] when stop has failed
37
37
  #
38
38
  def run_on_change(paths)
39
+ return run_all unless @tracker.checks
40
+
39
41
  puts "rescanning #{paths}, running all checks"
40
42
  report = ::Brakeman::rescan(@tracker, paths)
41
- print_failed(report)
43
+ print_changed(report)
42
44
  throw :task_has_failed if report.any_warnings?
43
45
  end
44
46
 
@@ -46,8 +48,27 @@ module Guard
46
48
 
47
49
  def print_failed report
48
50
  puts "\n------ brakeman warnings --------\n"
49
- report.all_warnings.each do |w|
50
- puts w.to_row
51
+ puts report.all_warnings.sort_by { |w| w.confidence }
52
+ end
53
+
54
+ def print_changed report
55
+ puts "\n------ brakeman warnings --------\n"
56
+
57
+ unless report.fixed_warnings.empty?
58
+ puts "#{report.fixed_warnings.length} fixed warnings:"
59
+ puts report.fixed_warnings.sort_by { |w| w.confidence }
60
+ puts
61
+ end
62
+
63
+ unless report.new_warnings.empty?
64
+ puts "#{report.new_warnings.length} new warnings:"
65
+ puts report.new_warnings.sort_by { |w| w.confidence }
66
+ puts
67
+ end
68
+
69
+ unless report.existing_warnings.empty?
70
+ puts "#{report.existing_warnings.length} previous warnings:"
71
+ puts report.existing_warnings.sort_by { |w| w.confidence }
51
72
  end
52
73
  end
53
74
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-brakeman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Neil Matatall
@@ -15,7 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-18 00:00:00 Z
18
+ date: 2012-01-27 00:00:00 -08:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: guard
@@ -41,11 +42,12 @@ dependencies:
41
42
  requirements:
42
43
  - - ">="
43
44
  - !ruby/object:Gem::Version
44
- hash: 11
45
+ hash: 27
45
46
  segments:
46
47
  - 1
47
48
  - 2
48
- version: "1.2"
49
+ - 2
50
+ version: 1.2.2
49
51
  type: :runtime
50
52
  version_requirements: *id002
51
53
  - !ruby/object:Gem::Dependency
@@ -94,6 +96,7 @@ files:
94
96
  - lib/guard/brakeman.rb
95
97
  - LICENSE
96
98
  - README.md
99
+ has_rdoc: true
97
100
  homepage: http://rubygems.org/gems/guard-brakeman
98
101
  licenses: []
99
102
 
@@ -125,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
128
  requirements: []
126
129
 
127
130
  rubyforge_project: guard-brakeman
128
- rubygems_version: 1.8.10
131
+ rubygems_version: 1.6.2
129
132
  signing_key:
130
133
  specification_version: 3
131
134
  summary: Guard gem for Brakeman