firespring_dev_commands 2.1.16.pre.alpha.1 → 2.1.16.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f810b97efdfffe33d29fc32b31c63e59e988e4c7b11e82d68a4cd6e85262a7b0
|
4
|
+
data.tar.gz: 965832c284d5276501f658c5a0d7d70c6a4b4f88ef84c834011bc4b6bdb1cd6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea9ffaa8921ed4c75f1e0c3c9262167fa45faa382d0d9074c22d4aa6a4318856dc380a7f23f5ce2b09e5a20197af193e587f102ded1bc09447c81c6a87aac092
|
7
|
+
data.tar.gz: ad5e684614fb9bcadba6a6a975712bf1a6ccd4d27687cb3e1288fd8efc34bea5cb1285c4da47b12f7a72f1eb283bb71f0e6bbae604ae071bb7d3d0eadbac9b69
|
@@ -3,11 +3,12 @@ module Dev
|
|
3
3
|
class Audit
|
4
4
|
# The class containing standardized information about an audit report
|
5
5
|
class Report
|
6
|
-
attr_accessor :items, :min_severity, :ignorelist, :filtered_items
|
6
|
+
attr_accessor :items, :min_severity, :error_on_unknown, :ignorelist, :filtered_items
|
7
7
|
|
8
8
|
def initialize(
|
9
9
|
items,
|
10
10
|
min_severity: ENV.fetch('MIN_SEVERITY', nil),
|
11
|
+
error_on_unknown: ENV.fetch('ERROR_ON_UNKNOWN', nil),
|
11
12
|
ignorelist: ENV['IGNORELIST'].to_s.split(/\s*,\s*/)
|
12
13
|
)
|
13
14
|
# Items should be an array of Item objects
|
@@ -15,12 +16,18 @@ module Dev
|
|
15
16
|
raise 'items must all be report items' unless @items.all?(Dev::Audit::Report::Item)
|
16
17
|
|
17
18
|
@min_severity = min_severity || Level::HIGH
|
19
|
+
@error_on_unknown = error_on_unknown
|
18
20
|
@ignorelist = Array(ignorelist).compact
|
19
21
|
end
|
20
22
|
|
21
23
|
# Get all severities greater than or equal to the minimum severity
|
22
24
|
def desired_severities
|
23
|
-
|
25
|
+
max_severity = if error_on_unknown.to_s.strip == 'true'
|
26
|
+
-1
|
27
|
+
else
|
28
|
+
-2
|
29
|
+
end
|
30
|
+
LEVELS.slice(LEVELS.find_index(min_severity)..max_severity)
|
24
31
|
end
|
25
32
|
|
26
33
|
# Run the filters against the report items and filter out any which should be excluded
|