openscap_parser 1.6.0 → 1.7.0

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: 6f10f20d16fca6f3b16000545209fcaac88b09f90543bc7e2d820aad743e74d3
4
- data.tar.gz: 731820564df8192f546ab0b08b106a90288603c97801bbfbecd043b410223825
3
+ metadata.gz: ce0283dd70cb4bd3915601b3b8af328c6204a6e726944e3e500c0349c077d573
4
+ data.tar.gz: d550c9a264579c57668a39e83cb1294aab294caabc7e2a07232f55f4d4d09031
5
5
  SHA512:
6
- metadata.gz: b9b787207f533bc039f38df9d6235e49aa22661c9f395f4f4802f8ae44e4cd9a461d3af76cf60af95b0163b268c835e163748ced0ade199619d29f718e6a78f3
7
- data.tar.gz: b9806ee3729be9b7a8bcdaa06e7db80bb39a63e92922cc312fac3814f98a60e1c9599fe29e9590d45a55a0d5d0836e20d62009d3945c1727457e6b87c57a4bd3
6
+ metadata.gz: ce05d654865ec030cb866c4b48da4dd3b0ded8b2884825745f525dc7ea396f2aebbf8bef29e6f04f5dac5c5440f256db706743ee056ca00706def25297ff02d3
7
+ data.tar.gz: 463109c35f867f37ab57e96d59c0360e4af4d91ecf73c14b813b1b9fe1294f9b4ca5364a4521ac40b5ef551c33fa6da631c1655580da60328f664d0f64e36377
@@ -52,12 +52,33 @@ module OpenscapParser
52
52
  end
53
53
  end
54
54
 
55
+ def refined_rules(attribute)
56
+ @refined_rules ||= @parsed_xml.xpath("refine-rule[@#{attribute}]").each_with_object({}) do |element, rr|
57
+ rr[element.at_xpath('@idref').text] = element.at_xpath("@#{attribute}")&.text
58
+ end
59
+ end
60
+
61
+ def refined_rule_severity
62
+ refined_rules('severity')
63
+ end
64
+
65
+ def refined_rule_role
66
+ refined_rules('role')
67
+ end
68
+
69
+ def refined_rule_weight
70
+ refined_rules('weight')
71
+ end
72
+
55
73
  def to_h
56
74
  {
57
75
  :id => id,
58
76
  :title => title,
59
77
  :description => description,
60
- :refined_values => refined_values
78
+ :refined_values => refined_values,
79
+ :refined_rule_severity => refined_rule_severity,
80
+ :refined_rule_role => refined_rule_role,
81
+ :refined_rule_weight => refined_rule_weight
61
82
  }
62
83
  end
63
84
  end
@@ -1,3 +1,3 @@
1
1
  module OpenscapParser
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openscap_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-12 00:00:00.000000000 Z
12
+ date: 2023-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri