cfn-nag 0.0.7 → 0.0.8

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/cfn_nag.rb +9 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56cf57973ea5a51f6165d0355ac413e2f7b19e71
4
- data.tar.gz: 9f7a7d3c17486bc4bde0c8bd1dd31ea387c7f2cb
3
+ metadata.gz: 898a03235a0e5f60db7d512e532421d8f3b13c8d
4
+ data.tar.gz: db5914055e86cb2e84cf050465c07a5ddc24b024
5
5
  SHA512:
6
- metadata.gz: 4fa7690fd912219ec16df21316844c2453881dd19bb76651f91d8d5c438a1e811c525d724120301b026f7e1c1a915c77e657d66d0814d4795f9b1e88d32541be
7
- data.tar.gz: 0c1fda4f9df20aa7e7c0e8372fe41374c2c09eb9a8f6b426e6c765e3144f7d0ba00bc0fbee0345a1e3b8298b27f31fc190b50bfe9a8e727595ecd346b4a89201
6
+ metadata.gz: 6bc90748561f981c22c07090c8fb6f544939a2d94dc6e1bfcecfe86a808448b35e663eecf8d29c00d9e3331ecd805f2cfd0c237275da00b32a1f1d91c43956df
7
+ data.tar.gz: 3a38d26c0124022075ff41869bb77a948b74d2fbb115dfd602e91009689b44b695c0624ff01c2c60846d36573f16bdd1a19238c3898c68cd99beb3831d393f20
@@ -40,11 +40,17 @@ class CfnNag
40
40
  private
41
41
 
42
42
  def audit_file(input_json_path:)
43
- fail 'not even legit JSON' unless legal_json?(input_json_path)
44
43
  @stop_processing = false
45
44
  @violations = []
46
45
 
47
- generic_json_rules input_json_path
46
+ unless legal_json?(input_json_path)
47
+ @violations << Violation.new(type: Violation::FAILING_VIOLATION,
48
+ message: 'not even legit JSON',
49
+ violating_code: IO.read(input_json_path))
50
+ @stop_processing = true
51
+ end
52
+
53
+ generic_json_rules input_json_path unless @stop_processing == true
48
54
 
49
55
  custom_rules input_json_path unless @stop_processing == true
50
56
 
@@ -58,7 +64,7 @@ class CfnNag
58
64
  if ::File.directory? input_json_path
59
65
  templates = find_templates_in_directory(directory: input_json_path)
60
66
  elsif ::File.file? input_json_path
61
- templates = [input_json_path]
67
+ templates = [input_json_path.path]
62
68
  else
63
69
  fail "#{input_json_path} is not a proper path"
64
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-nag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - someguy