guard-brakeman 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +2 -4
  2. data/lib/guard/brakeman.rb +6 -9
  3. metadata +11 -11
data/README.md CHANGED
@@ -2,10 +2,6 @@
2
2
 
3
3
  Guard::Brakeman allows you to automatically run [Brakeman](http://brakemanscanner.org/) tests when files are modified.
4
4
 
5
- Use guard-brakeman >= 0.4.0 for brakeman >= 1.5.3
6
- --------------
7
- And use < 0.4.0 for brakeman < 1.5.3
8
-
9
5
  ## Install
10
6
 
11
7
  The simplest way to install Guard is to use [Bundler](http://gembundler.com/).
@@ -53,6 +49,8 @@ Please read the [Guard documentation](http://github.com/guard/guard#readme) for
53
49
  ### List of available options
54
50
 
55
51
  ```ruby
52
+ :quiet => false # set the "quiet" option in brakeman (only results will be printed)
53
+ :ignore_file => 'config/brakeman.ignore'
56
54
  :output_files => %w(donkey.html) # write the results to the specified files
57
55
  :notifications => false # display Growl notifications, defaults to true
58
56
  :run_on_start => true # run all checks on startup, defaults to false
@@ -56,8 +56,9 @@ module Guard
56
56
  #
57
57
  def run_all
58
58
  @tracker.run_checks
59
- print_failed(@tracker.checks)
60
- throw :task_has_failed if @tracker.checks.all_warnings.any?
59
+ ::Brakeman.filter_warnings @tracker, @scanner_opts
60
+ print_failed(@tracker)
61
+ throw :task_has_failed if @tracker.filtered_warnings.any?
61
62
  end
62
63
 
63
64
  # Gets called when watched paths and files have changes.
@@ -67,7 +68,6 @@ module Guard
67
68
  #
68
69
  def run_on_changes paths
69
70
  return run_all unless @tracker.checks
70
-
71
71
  info "\n\nrescanning #{paths}, running all checks"
72
72
  report = ::Brakeman::rescan(@tracker, paths)
73
73
  print_changed(report)
@@ -76,13 +76,10 @@ module Guard
76
76
 
77
77
  private
78
78
 
79
- def print_failed report
79
+ def print_failed tracker
80
80
  info "\n------ brakeman warnings --------\n"
81
-
82
- icon = report.all_warnings.count > 0 ? :failed : :success
83
-
84
- all_warnings = report.all_warnings
85
-
81
+ all_warnings = tracker.filtered_warnings
82
+ icon = all_warnings.count > 0 ? :failed : :success
86
83
  message = "#{all_warnings.count} brakeman findings"
87
84
 
88
85
  if @options[:output_files]
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: 1
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 7
9
- - 1
10
- version: 0.7.1
8
+ - 8
9
+ - 0
10
+ version: 0.8.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Neil Matatall
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-07-29 00:00:00 Z
19
+ date: 2013-08-28 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: guard
@@ -42,12 +42,12 @@ dependencies:
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- hash: 51
45
+ hash: 11
46
46
  segments:
47
- - 1
48
- - 8
49
47
  - 2
50
- version: 1.8.2
48
+ - 1
49
+ - 0
50
+ version: 2.1.0
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
53
  description: Guard::Brakeman automatically scans your Rails app for vulnerabilities using the Brakeman Scaner https://github.com/presidentbeef/brakeman
@@ -64,8 +64,8 @@ files:
64
64
  - LICENSE
65
65
  - README.md
66
66
  homepage: https://github.com/guard/guard-brakeman
67
- licenses: []
68
-
67
+ licenses:
68
+ - MIT
69
69
  post_install_message:
70
70
  rdoc_options:
71
71
  - --charset=UTF-8