firespring_dev_commands 2.1.16.pre.alpha.1 → 2.1.16
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: a76815afd1e3b494fd7ba20ff9340bd247509baf62b9735cf78da2c94cf03739
|
4
|
+
data.tar.gz: 9e0d08dbe5a3dd36c5731dccb86e01815d70b1b6b79e2876ed618d647abb6fb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780323d83fce097f68cefc3a5a593e2630db8a585f39d6816915638a5ca3390a6aaa63ae9f759472e8eabe43ceacf3d2395f26a2d9aa539aa604a7abc7be4d81
|
7
|
+
data.tar.gz: 775ba3d95cb591fa540882f588dc038e080cccd11dda040006380c1c0cfba8f05b39cf3a596edd49fc9c7902e9afde56581e481da087322765cdc42bbb127185
|
@@ -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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.16
|
4
|
+
version: 2.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -403,9 +403,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
403
403
|
version: '3.1'
|
404
404
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
405
405
|
requirements:
|
406
|
-
- - "
|
406
|
+
- - ">="
|
407
407
|
- !ruby/object:Gem::Version
|
408
|
-
version:
|
408
|
+
version: '0'
|
409
409
|
requirements: []
|
410
410
|
rubygems_version: 3.4.10
|
411
411
|
signing_key:
|