abide_dev_utils 0.10.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +7 -1
  4. data/Gemfile.lock +25 -19
  5. data/Rakefile +28 -0
  6. data/abide_dev_utils.gemspec +1 -0
  7. data/lib/abide_dev_utils/cem/benchmark.rb +490 -0
  8. data/lib/abide_dev_utils/cem/generate/coverage_report.rb +380 -0
  9. data/lib/abide_dev_utils/cem/generate/reference.rb +319 -0
  10. data/lib/abide_dev_utils/cem/generate.rb +11 -0
  11. data/lib/abide_dev_utils/cem/hiera_data/mapping_data/map_data.rb +110 -0
  12. data/lib/abide_dev_utils/cem/hiera_data/mapping_data/mixins.rb +46 -0
  13. data/lib/abide_dev_utils/cem/hiera_data/mapping_data.rb +146 -0
  14. data/lib/abide_dev_utils/cem/hiera_data/resource_data/control.rb +127 -0
  15. data/lib/abide_dev_utils/cem/hiera_data/resource_data/parameters.rb +90 -0
  16. data/lib/abide_dev_utils/cem/hiera_data/resource_data/resource.rb +102 -0
  17. data/lib/abide_dev_utils/cem/hiera_data/resource_data.rb +310 -0
  18. data/lib/abide_dev_utils/cem/hiera_data.rb +7 -0
  19. data/lib/abide_dev_utils/cem/mapping/mapper.rb +282 -0
  20. data/lib/abide_dev_utils/cem/validate/resource_data.rb +33 -0
  21. data/lib/abide_dev_utils/cem/validate.rb +10 -0
  22. data/lib/abide_dev_utils/cem.rb +1 -0
  23. data/lib/abide_dev_utils/cli/cem.rb +98 -0
  24. data/lib/abide_dev_utils/dot_number_comparable.rb +75 -0
  25. data/lib/abide_dev_utils/errors/cem.rb +32 -0
  26. data/lib/abide_dev_utils/errors/general.rb +8 -2
  27. data/lib/abide_dev_utils/errors/ppt.rb +4 -0
  28. data/lib/abide_dev_utils/errors.rb +6 -0
  29. data/lib/abide_dev_utils/markdown.rb +104 -0
  30. data/lib/abide_dev_utils/ppt/class_utils.rb +1 -1
  31. data/lib/abide_dev_utils/ppt/code_gen/data_types.rb +64 -0
  32. data/lib/abide_dev_utils/ppt/code_gen/generate.rb +15 -0
  33. data/lib/abide_dev_utils/ppt/code_gen/resource.rb +59 -0
  34. data/lib/abide_dev_utils/ppt/code_gen/resource_types/base.rb +93 -0
  35. data/lib/abide_dev_utils/ppt/code_gen/resource_types/class.rb +17 -0
  36. data/lib/abide_dev_utils/ppt/code_gen/resource_types/manifest.rb +16 -0
  37. data/lib/abide_dev_utils/ppt/code_gen/resource_types/parameter.rb +16 -0
  38. data/lib/abide_dev_utils/ppt/code_gen/resource_types/strings.rb +13 -0
  39. data/lib/abide_dev_utils/ppt/code_gen/resource_types.rb +6 -0
  40. data/lib/abide_dev_utils/ppt/code_gen.rb +15 -0
  41. data/lib/abide_dev_utils/ppt/code_introspection.rb +102 -0
  42. data/lib/abide_dev_utils/ppt/facter_utils.rb +140 -0
  43. data/lib/abide_dev_utils/ppt/hiera.rb +300 -0
  44. data/lib/abide_dev_utils/ppt/puppet_module.rb +75 -0
  45. data/lib/abide_dev_utils/ppt.rb +6 -5
  46. data/lib/abide_dev_utils/validate.rb +14 -0
  47. data/lib/abide_dev_utils/version.rb +1 -1
  48. data/lib/abide_dev_utils/xccdf/parser/helpers.rb +146 -0
  49. data/lib/abide_dev_utils/xccdf/parser/objects.rb +87 -144
  50. data/lib/abide_dev_utils/xccdf/parser.rb +5 -0
  51. data/lib/abide_dev_utils/xccdf/utils.rb +89 -0
  52. data/lib/abide_dev_utils/xccdf.rb +3 -0
  53. metadata +50 -3
  54. 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: c47baf812f2bb3b64951dc87b3aa1886eca947f0bf3a57bbed12b7ed7fda97ab
4
- data.tar.gz: 4488f609550b251474337f1574c5c216601035fc5bba1fc9acb76e278252b5b5
3
+ metadata.gz: 85fb0e453df008a48284f03fe59bd1577b733498ce030039e215bf1863e1767c
4
+ data.tar.gz: 9a89ac46e8506ea059044006a5c50d8132847fa2a8f9a6b726174ed51ab6421c
5
5
  SHA512:
6
- metadata.gz: f4e517c44f1c728689d1de11d0e306f65352ecf1b0507671d588ac5eb21dc294ac7bca68e7c790f21b9a47fa565ed775c2a28ce45257395203a0fa296c6f4389
7
- data.tar.gz: 2b5ff4f1ad40d4000bb93862902c1a89e4620632825d19a34cd118fa43cc15823132cb4e9d246a1655ad1f6bd9636581398651e9082e8b16129f0c79eba9a5df
6
+ metadata.gz: 9f221ac5c9c15db1414005ca4017dda7a9f848d8b7586d4b8a3ede9ecaf5fc8e35187ab2f172e127cad92a1d483befe31fa17278279b54b33abcc1d25f7a21a6
7
+ data.tar.gz: b9f3e5553a03faed668600c94b44759ee4554165e20722b7c6d5108add327ba23a6986e707034647b3eed400e6217b032eb058e537a74f26d11a004cf309bcfd
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,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abide_dev_utils (0.10.1)
4
+ abide_dev_utils (0.11.2)
5
5
  amatch (~> 0.4)
6
6
  cmdparse (~> 3.0)
7
+ facterdb (>= 1.18)
7
8
  google-cloud-storage (~> 1.34)
8
9
  hashdiff (~> 1.0)
9
10
  jira-ruby (~> 2.2)
@@ -59,9 +60,12 @@ GEM
59
60
  diff-lcs (1.5.0)
60
61
  digest-crc (0.6.4)
61
62
  rake (>= 12.0.0, < 14.0.0)
62
- facter (4.2.10)
63
+ facter (4.2.11)
63
64
  hocon (~> 1.3)
64
65
  thor (>= 1.0.1, < 2.0)
66
+ facterdb (1.19.0)
67
+ facter (< 5.0.0)
68
+ jgrep
65
69
  faraday (2.3.0)
66
70
  faraday-net_http (~> 2.0)
67
71
  ruby2_keywords (>= 0.0.4)
@@ -80,7 +84,7 @@ GEM
80
84
  octokit (~> 4.6)
81
85
  rainbow (>= 2.2.1)
82
86
  rake (>= 10.0)
83
- google-apis-core (0.5.0)
87
+ google-apis-core (0.7.0)
84
88
  addressable (~> 2.5, >= 2.5.1)
85
89
  googleauth (>= 0.16.2, < 2.a)
86
90
  httpclient (>= 2.8.1, < 3.a)
@@ -89,25 +93,25 @@ GEM
89
93
  retriable (>= 2.0, < 4.a)
90
94
  rexml
91
95
  webrick
92
- google-apis-iamcredentials_v1 (0.10.0)
93
- google-apis-core (>= 0.4, < 2.a)
94
- google-apis-storage_v1 (0.14.0)
95
- google-apis-core (>= 0.4, < 2.a)
96
+ google-apis-iamcredentials_v1 (0.13.0)
97
+ google-apis-core (>= 0.7, < 2.a)
98
+ google-apis-storage_v1 (0.17.0)
99
+ google-apis-core (>= 0.7, < 2.a)
96
100
  google-cloud-core (1.6.0)
97
101
  google-cloud-env (~> 1.0)
98
102
  google-cloud-errors (~> 1.0)
99
103
  google-cloud-env (1.6.0)
100
104
  faraday (>= 0.17.3, < 3.0)
101
105
  google-cloud-errors (1.2.0)
102
- google-cloud-storage (1.36.2)
106
+ google-cloud-storage (1.38.0)
103
107
  addressable (~> 2.8)
104
108
  digest-crc (~> 0.4)
105
109
  google-apis-iamcredentials_v1 (~> 0.1)
106
- google-apis-storage_v1 (~> 0.1)
110
+ google-apis-storage_v1 (~> 0.17.0)
107
111
  google-cloud-core (~> 1.6)
108
112
  googleauth (>= 0.16.2, < 2.a)
109
113
  mini_mime (~> 1.0)
110
- googleauth (1.1.3)
114
+ googleauth (1.2.0)
111
115
  faraday (>= 0.17.3, < 3.a)
112
116
  jwt (>= 1.4, < 3.0)
113
117
  memoist (~> 0.16)
@@ -115,17 +119,18 @@ GEM
115
119
  os (>= 0.9, < 2.0)
116
120
  signet (>= 0.16, < 2.a)
117
121
  hashdiff (1.0.1)
118
- hiera (3.9.0)
122
+ hiera (3.10.0)
119
123
  hocon (1.3.1)
120
124
  httpclient (2.8.3)
121
125
  i18n (1.10.0)
122
126
  concurrent-ruby (~> 1.0)
127
+ jgrep (1.5.4)
123
128
  jira-ruby (2.2.0)
124
129
  activesupport
125
130
  atlassian-jwt
126
131
  multipart-post
127
132
  oauth (~> 0.5, >= 0.5.0)
128
- jwt (2.3.0)
133
+ jwt (2.4.1)
129
134
  locale (2.1.3)
130
135
  memoist (0.16.2)
131
136
  method_source (1.0.0)
@@ -134,12 +139,12 @@ GEM
134
139
  mize (0.4.0)
135
140
  protocol (~> 2.0)
136
141
  multi_json (1.15.0)
137
- multipart-post (2.1.1)
142
+ multipart-post (2.2.3)
138
143
  nio4r (2.5.8)
139
- nokogiri (1.13.6-x86_64-darwin)
144
+ nokogiri (1.13.8-x86_64-darwin)
140
145
  racc (~> 1.4)
141
146
  oauth (0.5.10)
142
- octokit (4.23.0)
147
+ octokit (4.25.0)
143
148
  faraday (>= 1, < 3)
144
149
  sawyer (~> 0.9)
145
150
  os (1.1.4)
@@ -159,7 +164,7 @@ GEM
159
164
  coderay (~> 1.1)
160
165
  method_source (~> 1.0)
161
166
  public_suffix (4.0.7)
162
- puppet (7.17.0-universal-darwin)
167
+ puppet (7.18.0-universal-darwin)
163
168
  CFPropertyList (~> 2.2)
164
169
  concurrent-ruby (~> 1.0)
165
170
  deep_merge (~> 1.0)
@@ -219,7 +224,7 @@ GEM
219
224
  ruby_parser (3.19.1)
220
225
  sexp_processor (~> 4.16)
221
226
  rubyzip (2.3.2)
222
- sawyer (0.9.1)
227
+ sawyer (0.9.2)
223
228
  addressable (>= 2.3.5)
224
229
  faraday (>= 0.17.3, < 3)
225
230
  scanf (1.0.0)
@@ -229,9 +234,9 @@ GEM
229
234
  rubyzip (>= 1.2.2)
230
235
  semantic_puppet (1.0.4)
231
236
  sexp_processor (4.16.1)
232
- signet (0.16.1)
237
+ signet (0.17.0)
233
238
  addressable (~> 2.8)
234
- faraday (>= 0.17.5, < 3.0)
239
+ faraday (>= 0.17.5, < 3.a)
235
240
  jwt (>= 1.5, < 3.0)
236
241
  multi_json (~> 1.10)
237
242
  sync (0.5.0)
@@ -249,6 +254,7 @@ GEM
249
254
 
250
255
  PLATFORMS
251
256
  x86_64-darwin-19
257
+ x86_64-linux
252
258
 
253
259
  DEPENDENCIES
254
260
  abide_dev_utils!
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
@@ -41,6 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_dependency 'google-cloud-storage', '~> 1.34'
42
42
  spec.add_dependency 'hashdiff', '~> 1.0'
43
43
  spec.add_dependency 'amatch', '~> 0.4'
44
+ spec.add_dependency 'facterdb', '>= 1.18'
44
45
 
45
46
  # Dev dependencies
46
47
  spec.add_development_dependency 'bundler'