compliance 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/compliance.rb +9 -3
- data/lib/compliance/loader.rb +1 -1
- data/lib/compliance/version.rb +1 -1
- data/lib/compliance.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8f7ad92baa85021ad2f6d1fc1f38fe8b0661cbcfdc1a186d57a786fe66314a0
|
4
|
+
data.tar.gz: e72c020cae731fe2d6352e0eb994417ff5cfafe98f016b0ac9b87ab3fd0fc235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1e1049191d15e7ab231a33350099e5367ab4fd2a97028a86f39bd16586147c11272083020b9b754288736b3927a9a71555cd91c7e303afadaf1b01bb2a7c4f7
|
7
|
+
data.tar.gz: 03a598d1cf4378bf12d8c5469dd3421165d3c220a1261ee63219281325990df8b4ed270ab4005fbd98086e32d2a1c8a2135a8fe03a76623f9a517acef8260bd5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/compliance.rb
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2024, by Samuel Williams.
|
5
5
|
|
6
|
+
def initialize(...)
|
7
|
+
super
|
8
|
+
|
9
|
+
require 'compliance'
|
10
|
+
end
|
11
|
+
|
6
12
|
def document
|
7
13
|
document = Compliance::Document.new
|
8
14
|
|
@@ -21,15 +27,15 @@ def check(input:)
|
|
21
27
|
policy = Compliance::Policy.new
|
22
28
|
document = input || self.document
|
23
29
|
|
24
|
-
|
30
|
+
failed_requirements = {}
|
25
31
|
|
26
32
|
document.check(policy) do |requirement, satisfied, unsatisfied|
|
27
33
|
Console.debug(self) {"Requirement #{requirement.id} is #{satisfied.any? ? "satisfied." : "not satisfied!"}"}
|
28
34
|
|
29
35
|
if satisfied.empty?
|
30
|
-
|
36
|
+
failed_requirements[requirement.id] = requirement
|
31
37
|
end
|
32
38
|
end
|
33
39
|
|
34
|
-
raise Compliance::Error.new(
|
40
|
+
raise Compliance::Error.new(failed_requirements) unless failed_requirements.empty?
|
35
41
|
end
|
data/lib/compliance/loader.rb
CHANGED
@@ -12,7 +12,7 @@ module Compliance
|
|
12
12
|
# Load compliance data from JSON files.
|
13
13
|
module Loader
|
14
14
|
def self.add(compliance, document)
|
15
|
-
compliance[:requirements]
|
15
|
+
compliance[:requirements]&.each do |metadata|
|
16
16
|
document.add_requirement(Requirement.new(metadata))
|
17
17
|
end
|
18
18
|
|
data/lib/compliance/version.rb
CHANGED
data/lib/compliance.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|