abide_dev_utils 0.9.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +7 -1
  4. data/Gemfile.lock +82 -64
  5. data/Rakefile +28 -0
  6. data/abide_dev_utils.gemspec +3 -1
  7. data/lib/abide_dev_utils/cem/benchmark.rb +291 -0
  8. data/lib/abide_dev_utils/cem/coverage_report.rb +348 -0
  9. data/lib/abide_dev_utils/cem/generate/reference.rb +116 -0
  10. data/lib/abide_dev_utils/cem/generate.rb +10 -0
  11. data/lib/abide_dev_utils/cem/mapping/mapper.rb +155 -0
  12. data/lib/abide_dev_utils/cem.rb +74 -0
  13. data/lib/abide_dev_utils/cli/cem.rb +153 -0
  14. data/lib/abide_dev_utils/cli/jira.rb +1 -1
  15. data/lib/abide_dev_utils/cli/xccdf.rb +15 -1
  16. data/lib/abide_dev_utils/cli.rb +2 -0
  17. data/lib/abide_dev_utils/errors/cem.rb +22 -0
  18. data/lib/abide_dev_utils/errors/general.rb +8 -2
  19. data/lib/abide_dev_utils/errors/ppt.rb +4 -0
  20. data/lib/abide_dev_utils/errors.rb +6 -0
  21. data/lib/abide_dev_utils/files.rb +34 -0
  22. data/lib/abide_dev_utils/markdown.rb +104 -0
  23. data/lib/abide_dev_utils/ppt/facter_utils.rb +140 -0
  24. data/lib/abide_dev_utils/ppt/hiera.rb +297 -0
  25. data/lib/abide_dev_utils/ppt/puppet_module.rb +74 -0
  26. data/lib/abide_dev_utils/ppt.rb +3 -5
  27. data/lib/abide_dev_utils/validate.rb +14 -0
  28. data/lib/abide_dev_utils/version.rb +1 -1
  29. data/lib/abide_dev_utils/xccdf/diff/benchmark/number_title.rb +270 -0
  30. data/lib/abide_dev_utils/xccdf/diff/benchmark/profile.rb +104 -0
  31. data/lib/abide_dev_utils/xccdf/diff/benchmark/property.rb +127 -0
  32. data/lib/abide_dev_utils/xccdf/diff/benchmark/property_existence.rb +47 -0
  33. data/lib/abide_dev_utils/xccdf/diff/benchmark.rb +267 -0
  34. data/lib/abide_dev_utils/xccdf/diff/utils.rb +30 -0
  35. data/lib/abide_dev_utils/xccdf/diff.rb +233 -0
  36. data/lib/abide_dev_utils/xccdf/parser/objects/digest_object.rb +118 -0
  37. data/lib/abide_dev_utils/xccdf/parser/objects/numbered_object.rb +104 -0
  38. data/lib/abide_dev_utils/xccdf/parser/objects.rb +741 -0
  39. data/lib/abide_dev_utils/xccdf/parser.rb +52 -0
  40. data/lib/abide_dev_utils/xccdf.rb +14 -124
  41. data/new_diff.rb +48 -0
  42. metadata +60 -9
  43. data/lib/abide_dev_utils/ppt/coverage.rb +0 -86
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc24decc17e394464d7ccfe4b461e8e6a5e74792b3a6a76092d5bc8d1fc9d87f
4
- data.tar.gz: 43811951c377e43d3e6a10b9d295e807472d17b37ddda143d1a7e3f39a277a6c
3
+ metadata.gz: 7cf13209260261bcf509e7953d4af4a47aa7301cc7c2e8227c3d736d163cd0b1
4
+ data.tar.gz: a6d6cb52aadf58e33ce6a57d77c7921226ebb130aa2d6e4350c42c197df0f06c
5
5
  SHA512:
6
- metadata.gz: 8228550f80f8234306b6f47ec45d4abd62df2953826b40cd225f8431753f1d72eff7e5c4caec2d5adedeac45d77c495116e606d3d8e66cfb2f662d92306e3f79
7
- data.tar.gz: 7bd968ca178a24897184997445d36ece5e6c2bcbdd0a3bed9156b984c58cce1b4e289e9e8894a71d3a3ccab0d02c25a88b2b5005190db97e49f40173c0ed6479
6
+ metadata.gz: be0ac34b2ee3ea116793580ef1ffff41ca4f11b41ceb6587866183734f1aee15a566b5a0063b106a18962739a1d4d7091d6e8d276dffdf6101cfcfb48afb3832
7
+ data.tar.gz: 97f9b753cb94f1a1d326eb370a59ae35d00a3c2797b6e030941e51f51e9f7713eca0af9148f9858a0f4c375273bb468ab1df928cd589903d48b9bbe7c86a92fd
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  /coverage/
5
5
  /doc/
6
6
  /pkg/
7
+ /spec/fixtures/
7
8
  /spec/reports/
8
9
  /tmp/
9
10
  w10_20h2.xml
data/.rubocop.yml CHANGED
@@ -39,6 +39,9 @@ Style/IpAddresses:
39
39
  Exclude:
40
40
  - spec/rubocop/cop/style/ip_addresses_spec.rb
41
41
 
42
+ Style/RegexpLiteral:
43
+ Enabled: false
44
+
42
45
  Layout/EndOfLine:
43
46
  EnforcedStyle: lf
44
47
 
@@ -133,4 +136,7 @@ Performance/CollectionLiteralInLoop:
133
136
  - 'spec/**/*.rb'
134
137
 
135
138
  RSpec/StubbedMock:
136
- Enabled: false
139
+ Enabled: false
140
+
141
+ Convention/ExplicitBlockArgument:
142
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abide_dev_utils (0.9.7)
4
+ abide_dev_utils (0.11.0)
5
+ amatch (~> 0.4)
5
6
  cmdparse (~> 3.0)
7
+ facterdb (>= 1.18)
6
8
  google-cloud-storage (~> 1.34)
7
9
  hashdiff (~> 1.0)
8
10
  jira-ruby (~> 2.2)
9
- nokogiri (~> 1.11)
11
+ nokogiri (~> 1.13)
10
12
  puppet (>= 6.23)
11
13
  ruby-progressbar (~> 1.11)
12
14
  selenium-webdriver (~> 4.0.0.beta4)
@@ -14,73 +16,62 @@ PATH
14
16
  GEM
15
17
  remote: https://rubygems.org/
16
18
  specs:
17
- activesupport (7.0.2.2)
19
+ CFPropertyList (2.3.6)
20
+ activesupport (7.0.3)
18
21
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
22
  i18n (>= 1.6, < 2)
20
23
  minitest (>= 5.1)
21
24
  tzinfo (~> 2.0)
22
25
  addressable (2.8.0)
23
26
  public_suffix (>= 2.0.2, < 5.0)
27
+ amatch (0.4.1)
28
+ mize
29
+ tins (~> 1.0)
24
30
  ast (2.4.2)
25
- async (1.30.1)
31
+ async (1.30.2)
26
32
  console (~> 1.10)
27
33
  nio4r (~> 2.3)
28
34
  timers (~> 4.1)
29
- async-http (0.56.5)
35
+ async-http (0.56.6)
30
36
  async (>= 1.25)
31
37
  async-io (>= 1.28)
32
38
  async-pool (>= 0.2)
33
39
  protocol-http (~> 0.22.0)
34
40
  protocol-http1 (~> 0.14.0)
35
41
  protocol-http2 (~> 0.14.0)
42
+ traces (~> 0.4.0)
36
43
  async-http-faraday (0.11.0)
37
44
  async-http (~> 0.42)
38
45
  faraday
39
- async-io (1.32.2)
46
+ async-io (1.33.0)
40
47
  async
41
- async-pool (0.3.9)
48
+ async-pool (0.3.10)
42
49
  async (>= 1.25)
43
50
  atlassian-jwt (0.2.1)
44
51
  jwt (~> 2.1)
45
52
  childprocess (4.1.0)
46
53
  cmdparse (3.0.7)
47
54
  coderay (1.1.3)
48
- concurrent-ruby (1.1.9)
49
- console (1.14.0)
55
+ concurrent-ruby (1.1.10)
56
+ console (1.15.3)
50
57
  fiber-local
51
58
  declarative (0.0.20)
52
59
  deep_merge (1.2.2)
53
60
  diff-lcs (1.5.0)
54
61
  digest-crc (0.6.4)
55
62
  rake (>= 12.0.0, < 14.0.0)
56
- facter (4.2.7)
63
+ facter (4.2.10)
57
64
  hocon (~> 1.3)
58
65
  thor (>= 1.0.1, < 2.0)
59
- faraday (1.10.0)
60
- faraday-em_http (~> 1.0)
61
- faraday-em_synchrony (~> 1.0)
62
- faraday-excon (~> 1.1)
63
- faraday-httpclient (~> 1.0)
64
- faraday-multipart (~> 1.0)
65
- faraday-net_http (~> 1.0)
66
- faraday-net_http_persistent (~> 1.0)
67
- faraday-patron (~> 1.0)
68
- faraday-rack (~> 1.0)
69
- faraday-retry (~> 1.0)
66
+ facterdb (1.18.0)
67
+ facter (< 5.0.0)
68
+ jgrep
69
+ faraday (2.3.0)
70
+ faraday-net_http (~> 2.0)
70
71
  ruby2_keywords (>= 0.0.4)
71
- faraday-em_http (1.0.0)
72
- faraday-em_synchrony (1.0.0)
73
- faraday-excon (1.1.0)
74
- faraday-http-cache (2.2.0)
72
+ faraday-http-cache (2.3.0)
75
73
  faraday (>= 0.8)
76
- faraday-httpclient (1.0.1)
77
- faraday-multipart (1.0.3)
78
- multipart-post (>= 1.2, < 3)
79
- faraday-net_http (1.0.1)
80
- faraday-net_http_persistent (1.2.0)
81
- faraday-patron (1.0.0)
82
- faraday-rack (1.0.0)
83
- faraday-retry (1.0.3)
74
+ faraday-net_http (2.0.3)
84
75
  fast_gettext (1.8.0)
85
76
  fiber-local (1.0.0)
86
77
  gem-release (2.2.2)
@@ -93,7 +84,7 @@ GEM
93
84
  octokit (~> 4.6)
94
85
  rainbow (>= 2.2.1)
95
86
  rake (>= 10.0)
96
- google-apis-core (0.4.2)
87
+ google-apis-core (0.5.0)
97
88
  addressable (~> 2.5, >= 2.5.1)
98
89
  googleauth (>= 0.16.2, < 2.a)
99
90
  httpclient (>= 2.8.1, < 3.a)
@@ -104,15 +95,15 @@ GEM
104
95
  webrick
105
96
  google-apis-iamcredentials_v1 (0.10.0)
106
97
  google-apis-core (>= 0.4, < 2.a)
107
- google-apis-storage_v1 (0.11.0)
98
+ google-apis-storage_v1 (0.14.0)
108
99
  google-apis-core (>= 0.4, < 2.a)
109
100
  google-cloud-core (1.6.0)
110
101
  google-cloud-env (~> 1.0)
111
102
  google-cloud-errors (~> 1.0)
112
- google-cloud-env (1.5.0)
113
- faraday (>= 0.17.3, < 2.0)
103
+ google-cloud-env (1.6.0)
104
+ faraday (>= 0.17.3, < 3.0)
114
105
  google-cloud-errors (1.2.0)
115
- google-cloud-storage (1.36.1)
106
+ google-cloud-storage (1.36.2)
116
107
  addressable (~> 2.8)
117
108
  digest-crc (~> 0.4)
118
109
  google-apis-iamcredentials_v1 (~> 0.1)
@@ -120,7 +111,7 @@ GEM
120
111
  google-cloud-core (~> 1.6)
121
112
  googleauth (>= 0.16.2, < 2.a)
122
113
  mini_mime (~> 1.0)
123
- googleauth (1.1.2)
114
+ googleauth (1.1.3)
124
115
  faraday (>= 0.17.3, < 3.a)
125
116
  jwt (>= 1.4, < 3.0)
126
117
  memoist (~> 0.16)
@@ -128,11 +119,12 @@ GEM
128
119
  os (>= 0.9, < 2.0)
129
120
  signet (>= 0.16, < 2.a)
130
121
  hashdiff (1.0.1)
131
- hiera (3.8.0)
122
+ hiera (3.9.0)
132
123
  hocon (1.3.1)
133
124
  httpclient (2.8.3)
134
125
  i18n (1.10.0)
135
126
  concurrent-ruby (~> 1.0)
127
+ jgrep (1.5.4)
136
128
  jira-ruby (2.2.0)
137
129
  activesupport
138
130
  atlassian-jwt
@@ -144,22 +136,28 @@ GEM
144
136
  method_source (1.0.0)
145
137
  mini_mime (1.1.2)
146
138
  minitest (5.15.0)
139
+ mize (0.4.0)
140
+ protocol (~> 2.0)
147
141
  multi_json (1.15.0)
148
142
  multipart-post (2.1.1)
149
143
  nio4r (2.5.8)
150
- nokogiri (1.13.3-x86_64-darwin)
144
+ nokogiri (1.13.6-x86_64-darwin)
151
145
  racc (~> 1.4)
152
- oauth (0.5.8)
153
- octokit (4.22.0)
154
- faraday (>= 0.9)
155
- sawyer (~> 0.8.0, >= 0.5.3)
146
+ nokogiri (1.13.6-x86_64-linux)
147
+ racc (~> 1.4)
148
+ oauth (0.5.10)
149
+ octokit (4.25.0)
150
+ faraday (>= 1, < 3)
151
+ sawyer (~> 0.9)
156
152
  os (1.1.4)
157
- parallel (1.21.0)
158
- parser (3.1.1.0)
153
+ parallel (1.22.1)
154
+ parser (3.1.2.0)
159
155
  ast (~> 2.4.1)
156
+ protocol (2.0.0)
157
+ ruby_parser (~> 3.0)
160
158
  protocol-hpack (1.4.2)
161
- protocol-http (0.22.5)
162
- protocol-http1 (0.14.2)
159
+ protocol-http (0.22.6)
160
+ protocol-http1 (0.14.4)
163
161
  protocol-http (~> 0.22)
164
162
  protocol-http2 (0.14.2)
165
163
  protocol-hpack (~> 1.4)
@@ -167,8 +165,20 @@ GEM
167
165
  pry (0.14.1)
168
166
  coderay (~> 1.1)
169
167
  method_source (~> 1.0)
170
- public_suffix (4.0.6)
171
- puppet (7.14.0)
168
+ public_suffix (4.0.7)
169
+ puppet (7.17.0)
170
+ concurrent-ruby (~> 1.0)
171
+ deep_merge (~> 1.0)
172
+ facter (> 2.0.1, < 5)
173
+ fast_gettext (>= 1.1, < 3)
174
+ hiera (>= 3.2.1, < 4)
175
+ locale (~> 2.1)
176
+ multi_json (~> 1.10)
177
+ puppet-resource_api (~> 1.5)
178
+ scanf (~> 1.0)
179
+ semantic_puppet (~> 1.0)
180
+ puppet (7.17.0-universal-darwin)
181
+ CFPropertyList (~> 2.2)
172
182
  concurrent-ruby (~> 1.0)
173
183
  deep_merge (~> 1.0)
174
184
  facter (> 2.0.1, < 5)
@@ -184,8 +194,8 @@ GEM
184
194
  racc (1.6.0)
185
195
  rainbow (3.1.1)
186
196
  rake (13.0.6)
187
- regexp_parser (2.2.1)
188
- representable (3.1.1)
197
+ regexp_parser (2.5.0)
198
+ representable (3.2.0)
189
199
  declarative (< 0.1.0)
190
200
  trailblazer-option (>= 0.1.1, < 0.2.0)
191
201
  uber (< 0.2.0)
@@ -200,47 +210,54 @@ GEM
200
210
  rspec-expectations (3.11.0)
201
211
  diff-lcs (>= 1.2.0, < 2.0)
202
212
  rspec-support (~> 3.11.0)
203
- rspec-mocks (3.11.0)
213
+ rspec-mocks (3.11.1)
204
214
  diff-lcs (>= 1.2.0, < 2.0)
205
215
  rspec-support (~> 3.11.0)
206
216
  rspec-support (3.11.0)
207
- rubocop (1.25.1)
217
+ rubocop (1.30.0)
208
218
  parallel (~> 1.10)
209
219
  parser (>= 3.1.0.0)
210
220
  rainbow (>= 2.2.2, < 4.0)
211
221
  regexp_parser (>= 1.8, < 3.0)
212
- rexml
213
- rubocop-ast (>= 1.15.1, < 2.0)
222
+ rexml (>= 3.2.5, < 4.0)
223
+ rubocop-ast (>= 1.18.0, < 2.0)
214
224
  ruby-progressbar (~> 1.7)
215
225
  unicode-display_width (>= 1.4.0, < 3.0)
216
- rubocop-ast (1.16.0)
226
+ rubocop-ast (1.18.0)
217
227
  parser (>= 3.1.1.0)
218
228
  rubocop-i18n (3.0.0)
219
229
  rubocop (~> 1.0)
220
- rubocop-performance (1.13.2)
230
+ rubocop-performance (1.14.0)
221
231
  rubocop (>= 1.7.0, < 2.0)
222
232
  rubocop-ast (>= 0.4.0)
223
- rubocop-rspec (2.9.0)
233
+ rubocop-rspec (2.11.1)
224
234
  rubocop (~> 1.19)
225
235
  ruby-progressbar (1.11.0)
226
236
  ruby2_keywords (0.0.5)
237
+ ruby_parser (3.19.1)
238
+ sexp_processor (~> 4.16)
227
239
  rubyzip (2.3.2)
228
- sawyer (0.8.2)
240
+ sawyer (0.9.2)
229
241
  addressable (>= 2.3.5)
230
- faraday (> 0.8, < 2.0)
242
+ faraday (>= 0.17.3, < 3)
231
243
  scanf (1.0.0)
232
244
  selenium-webdriver (4.0.3)
233
245
  childprocess (>= 0.5, < 5.0)
234
246
  rexml (~> 3.2, >= 3.2.5)
235
247
  rubyzip (>= 1.2.2)
236
248
  semantic_puppet (1.0.4)
249
+ sexp_processor (4.16.1)
237
250
  signet (0.16.1)
238
251
  addressable (~> 2.8)
239
252
  faraday (>= 0.17.5, < 3.0)
240
253
  jwt (>= 1.5, < 3.0)
241
254
  multi_json (~> 1.10)
255
+ sync (0.5.0)
242
256
  thor (1.2.1)
243
257
  timers (4.3.3)
258
+ tins (1.31.1)
259
+ sync
260
+ traces (0.4.1)
244
261
  trailblazer-option (0.1.2)
245
262
  tzinfo (2.0.4)
246
263
  concurrent-ruby (~> 1.0)
@@ -249,7 +266,8 @@ GEM
249
266
  webrick (1.7.0)
250
267
 
251
268
  PLATFORMS
252
- ruby
269
+ x86_64-darwin-19
270
+ x86_64-linux
253
271
 
254
272
  DEPENDENCIES
255
273
  abide_dev_utils!
@@ -268,4 +286,4 @@ DEPENDENCIES
268
286
  rubocop-rspec (~> 2.1)
269
287
 
270
288
  BUNDLED WITH
271
- 2.1.4
289
+ 2.3.9
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rake'
3
4
  require "bundler/gem_tasks"
4
5
  require "rspec/core/rake_task"
5
6
 
@@ -10,3 +11,30 @@ require "rubocop/rake_task"
10
11
  RuboCop::RakeTask.new
11
12
 
12
13
  task default: %i[spec rubocop]
14
+
15
+ namespace 'cem' do
16
+ directory 'spec/fixtures'
17
+
18
+ directory 'spec/fixtures/puppetlabs-cem_linux' do
19
+ sh 'git clone git@github.com:puppetlabs/puppetlabs-cem_linux.git spec/fixtures/puppetlabs-cem_linux'
20
+ end
21
+ file 'spec/fixtures/puppetlabs-cem_linux' => ['spec/fixtures']
22
+
23
+ directory 'spec/fixtures/puppetlabs-cem_windows' do
24
+ sh 'git clone git@github.com:puppetlabs/puppetlabs-cem_windows.git spec/fixtures/puppetlabs-cem_windows'
25
+ end
26
+ file 'spec/fixtures/puppetlabs-cem_windows' => ['spec/fixtures']
27
+
28
+ task :fixture, [:cem_mod] do |_, args|
29
+ case args.cem_mod
30
+ when /linux/
31
+ Rake::Task['spec/fixtures/puppetlabs-cem_linux'].invoke
32
+ when /windows/
33
+ Rake::Task['spec/fixtures/puppetlabs-cem_windows'].invoke
34
+ else
35
+ raise "Unknown CEM module #{args.cem_mod}"
36
+ end
37
+ end
38
+
39
+ multitask fixtures: %w[spec/fixtures/puppetlabs-cem_linux spec/fixtures/puppetlabs-cem_windows]
40
+ end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.require_paths = ['lib']
33
33
 
34
34
  # Prod dependencies
35
- spec.add_dependency 'nokogiri', '~> 1.11'
35
+ spec.add_dependency 'nokogiri', '~> 1.13'
36
36
  spec.add_dependency 'cmdparse', '~> 3.0'
37
37
  spec.add_dependency 'puppet', '>= 6.23'
38
38
  spec.add_dependency 'jira-ruby', '~> 2.2'
@@ -40,6 +40,8 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency 'selenium-webdriver', '~> 4.0.0.beta4'
41
41
  spec.add_dependency 'google-cloud-storage', '~> 1.34'
42
42
  spec.add_dependency 'hashdiff', '~> 1.0'
43
+ spec.add_dependency 'amatch', '~> 0.4'
44
+ spec.add_dependency 'facterdb', '>= 1.18'
43
45
 
44
46
  # Dev dependencies
45
47
  spec.add_development_dependency 'bundler'