guard-brakeman 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/guard/brakeman.rb +12 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2541290e9789eeffbcb3b044a6e00357a77bdfdd769a4e1535fe468d7e9d27a1
4
- data.tar.gz: 8ec143521f641ea82fbee2f7b9d37e57225d2f44abbbd2d17f211ff7baa2ca0b
3
+ metadata.gz: 0e638bf4913242e7d3c14aef4e494c7f36f7ae80021761fdea35052341c1f9f1
4
+ data.tar.gz: 8594c693f7c79426b5f7d7a03aada27bb28ae753cba824cc3315d9b693be1771
5
5
  SHA512:
6
- metadata.gz: 14fc831923193ff101f155b992565e3385675d450d151b4e65b5724c21d3bfa94703131828c0e1674530728dc6473fd85a3f2e894e389f7102e6f4bb03f8379b
7
- data.tar.gz: 4fd83223a0e8e62003573010e1be2daf405cb62c130813afbc95e1e34ad4d783bdc863f03cb7e2d1526b4550929b73aa749bfe40cc658b030b03a32ee99ed6a0
6
+ metadata.gz: cedfa43b252201fc70df63ca73a0c179fda9a015cda2a2adde5dbbacb4e546422adda3330cfe0b4af20cc4d0c64d6207fd8f5095f4c2faecd58ff5075d4ca583
7
+ data.tar.gz: ea87a798fdbd216f44a2f4400f8883c95e01b5fc8c2a8a2ff7aebfb1e38230f9ff9dbe3d8888b3f89f300006e2c4f35bbbee522b797a326e7e0a01b6eb301f41
@@ -50,7 +50,6 @@ module Guard
50
50
  def start
51
51
  @scanner_opts = ::Brakeman::set_options({:app_path => '.'}.merge(@options))
52
52
  @options.merge!(@scanner_opts)
53
- @tracker = ::Brakeman::Scanner.new(@scanner_opts).process
54
53
 
55
54
  if @options[:run_on_start]
56
55
  run_all
@@ -65,10 +64,10 @@ module Guard
65
64
  #
66
65
  def run_all
67
66
  fail "no scanner opts (start not called?)!" if @scanner_opts.nil?
68
- @tracker.run_checks
69
- ::Brakeman.filter_warnings @tracker, @scanner_opts
70
- print_failed(@tracker)
71
- throw :task_has_failed if @tracker.filtered_warnings.any?
67
+ tracker.run_checks
68
+ ::Brakeman.filter_warnings tracker, @scanner_opts
69
+ print_failed
70
+ throw :task_has_failed if tracker.filtered_warnings.any?
72
71
  end
73
72
 
74
73
  # Gets called when watched paths and files have changes.
@@ -77,16 +76,20 @@ module Guard
77
76
  # @raise [:task_has_failed] when stop has failed
78
77
  #
79
78
  def run_on_changes paths
80
- return run_all unless @tracker.checks
79
+ return run_all unless tracker.checks
81
80
  info "\n\nrescanning #{paths}, running all checks" unless options[:quiet]
82
- report = ::Brakeman::rescan(@tracker, paths)
81
+ report = ::Brakeman::rescan(tracker, paths)
83
82
  print_changed(report)
84
83
  throw :task_has_failed if report.any_warnings?
85
84
  end
86
85
 
87
86
  private
88
87
 
89
- def print_failed tracker
88
+ def tracker
89
+ @tracker ||= ::Brakeman::Scanner.new(@scanner_opts).process
90
+ end
91
+
92
+ def print_failed
90
93
  info "\n------ brakeman warnings --------\n" unless options[:quiet]
91
94
  all_warnings = tracker.filtered_warnings
92
95
  icon = all_warnings.count > 0 ? :failed : :success
@@ -166,7 +169,7 @@ module Guard
166
169
  def write_report
167
170
  @options[:output_files].each_with_index do |output_file, i|
168
171
  File.open output_file, "w" do |f|
169
- f.puts @tracker.report.send(@options[:output_formats][i])
172
+ f.puts tracker.report.send(@options[:output_formats][i])
170
173
  end
171
174
  end
172
175
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-brakeman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Matatall
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-08-12 00:00:00.000000000 Z
12
+ date: 2019-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard