abide_dev_utils 0.14.1 → 0.14.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: 54b60da7a8a67908351bf5e2687c39e8ac76aad00cb71ad798ac0c0a195e07fe
4
- data.tar.gz: 400a2593d83b24a0f970a52f4b6ae0434ff41975260b351c5dd5d0e52387f282
3
+ metadata.gz: b6af74f2a0eea495b7bf71fd843c668f556ee83cf45e3b6ebfafe4242278dcee
4
+ data.tar.gz: 6e9f6f60bc30f135bd4f2c6f35962626e81db410fc0c17631761c84e4551e1db
5
5
  SHA512:
6
- metadata.gz: 3857661d49e0fd254fda83c58ac0363cad5df50342aa55eca44f05f8e1dd47214200ef8586bbec6c1f46767cd7d0528be8f089507e0a6699896971ffceaca2da
7
- data.tar.gz: edaa3a7dc991292d51feba476cd49cf343e570ac87e0310957f4d55d43932fd3dc4ed6d72aa6f78fbc686063416e65ed0bbed03bf550fffcf63a135c3175d4af
6
+ metadata.gz: d61f39d043c94ab0ee2db46bd0374c99803fc720022606361f319e3b245c429700bffec7e9157ef11045cc7f5e25b21833b8bdc820ca1dcb32e7022ae7c89e3c
7
+ data.tar.gz: c2463568c53de7d0e0dfa0e4950484db5df6965888d2cae2b145f4dfba2816105f41aa413da4c07c9642da33c2a6b264a5cfd6504874db1de0f6de0eeef51675
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abide_dev_utils (0.14.1)
4
+ abide_dev_utils (0.14.2)
5
5
  amatch (~> 0.4)
6
6
  cmdparse (~> 3.0)
7
7
  facterdb (>= 1.21)
@@ -61,7 +61,7 @@ GEM
61
61
  diff-lcs (1.5.0)
62
62
  digest-crc (0.6.4)
63
63
  rake (>= 12.0.0, < 14.0.0)
64
- facter (4.2.14)
64
+ facter (4.3.0)
65
65
  hocon (~> 1.3)
66
66
  thor (>= 1.0.1, < 2.0)
67
67
  facterdb (1.21.0)
@@ -85,7 +85,7 @@ GEM
85
85
  octokit (~> 4.6)
86
86
  rainbow (>= 2.2.1)
87
87
  rake (>= 10.0)
88
- google-apis-core (0.10.0)
88
+ google-apis-core (0.11.0)
89
89
  addressable (~> 2.5, >= 2.5.1)
90
90
  googleauth (>= 0.16.2, < 2.a)
91
91
  httpclient (>= 2.8.1, < 3.a)
@@ -94,8 +94,8 @@ GEM
94
94
  retriable (>= 2.0, < 4.a)
95
95
  rexml
96
96
  webrick
97
- google-apis-iamcredentials_v1 (0.16.0)
98
- google-apis-core (>= 0.9.1, < 2.a)
97
+ google-apis-iamcredentials_v1 (0.17.0)
98
+ google-apis-core (>= 0.11.0, < 2.a)
99
99
  google-apis-storage_v1 (0.19.0)
100
100
  google-apis-core (>= 0.9.0, < 2.a)
101
101
  google-cloud-core (1.6.0)
@@ -103,7 +103,7 @@ GEM
103
103
  google-cloud-errors (~> 1.0)
104
104
  google-cloud-env (1.6.0)
105
105
  faraday (>= 0.17.3, < 3.0)
106
- google-cloud-errors (1.3.0)
106
+ google-cloud-errors (1.3.1)
107
107
  google-cloud-storage (1.44.0)
108
108
  addressable (~> 2.8)
109
109
  digest-crc (~> 0.4)
@@ -121,7 +121,7 @@ GEM
121
121
  signet (>= 0.16, < 2.a)
122
122
  hashdiff (1.0.1)
123
123
  hashie (5.0.0)
124
- hiera (3.11.0)
124
+ hiera (3.12.0)
125
125
  hocon (1.3.1)
126
126
  httpclient (2.8.3)
127
127
  i18n (1.12.0)
@@ -143,7 +143,7 @@ GEM
143
143
  multi_json (1.15.0)
144
144
  multipart-post (2.3.0)
145
145
  nio4r (2.5.8)
146
- nokogiri (1.14.1-x86_64-darwin)
146
+ nokogiri (1.14.2-x86_64-darwin)
147
147
  racc (~> 1.4)
148
148
  oauth (0.6.2)
149
149
  snaky_hash (~> 2.0)
@@ -168,7 +168,7 @@ GEM
168
168
  coderay (~> 1.1)
169
169
  method_source (~> 1.0)
170
170
  public_suffix (4.0.7)
171
- puppet (7.22.0-universal-darwin)
171
+ puppet (7.23.0-universal-darwin)
172
172
  CFPropertyList (~> 2.2)
173
173
  concurrent-ruby (~> 1.0, < 1.2.0)
174
174
  deep_merge (~> 1.0)
@@ -182,8 +182,8 @@ GEM
182
182
  semantic_puppet (~> 1.0)
183
183
  puppet-resource_api (1.8.14)
184
184
  hocon (>= 1.0)
185
- puppet-strings (2.9.0)
186
- rgen
185
+ puppet-strings (3.0.1)
186
+ rgen (~> 0.9.0)
187
187
  yard (~> 0.9.5)
188
188
  racc (1.6.2)
189
189
  rainbow (3.1.1)
@@ -229,7 +229,7 @@ GEM
229
229
  rubocop (~> 1.19)
230
230
  ruby-progressbar (1.11.0)
231
231
  ruby2_keywords (0.0.5)
232
- ruby_parser (3.19.2)
232
+ ruby_parser (3.20.0)
233
233
  sexp_processor (~> 4.16)
234
234
  rubyzip (2.3.2)
235
235
  sawyer (0.9.2)
@@ -485,8 +485,6 @@ module AbideDevUtils
485
485
  raise AbideDevUtils::Errors::ResourceDataNotFoundError, facts if rdata_files.nil? || rdata_files.empty?
486
486
 
487
487
  YAML.load_file(rdata_files[0].path)
488
- rescue StandardError => e
489
- require 'pry'; binding.pry
490
488
  end
491
489
  end
492
490
  end
@@ -236,12 +236,14 @@ module AbideDevUtils
236
236
  new_paths = []
237
237
  possible_fact_values.each do |pfv|
238
238
  new_path = path.dup
239
+ values = []
239
240
  pfv.each do |v|
240
241
  next unless v
241
242
 
243
+ values << v if v
242
244
  new_path.sub!(FACT_PATTERN, v)
243
245
  end
244
- new_paths << EntryPathLocalFile.new(new_path, facts, possible_fact_values)
246
+ new_paths << EntryPathLocalFile.new(new_path, facts, values)
245
247
  end
246
248
  new_paths.uniq(&:path).select(&:exist?)
247
249
  end
@@ -249,16 +251,13 @@ module AbideDevUtils
249
251
 
250
252
  # Represents a local file derived from a Hiera path
251
253
  class EntryPathLocalFile
252
- attr_reader :path, :facts
254
+ attr_reader :path, :facts, :values, :fact_values
253
255
 
254
- def initialize(path, facts, possible_fact_values)
256
+ def initialize(path, facts, values)
255
257
  @path = File.expand_path(File.join(AbideDevUtils::Ppt::Hiera.default_datadir, path))
256
258
  @facts = facts
257
- @possible_fact_values = possible_fact_values
258
- end
259
-
260
- def fact_values
261
- @fact_values ||= fact_values_for_path
259
+ @values = values
260
+ @fact_values = @facts.zip(@values).to_h
262
261
  end
263
262
 
264
263
  def path_parts
@@ -279,22 +278,6 @@ module AbideDevUtils
279
278
  facts: facts
280
279
  }
281
280
  end
282
-
283
- private
284
-
285
- def fact_values_for_path
286
- no_fext_path_parts = path_parts.map { |part| File.basename(part, '.yaml') }
287
- valid_fact_values = @possible_fact_values.select do |pfv|
288
- pfv.all? { |v| no_fext_path_parts.include?(v) }
289
- end
290
- valid_fact_values.uniq! # Removes duplicate arrays, not duplicate fact values
291
- valid_fact_values.flatten!
292
- return {} if valid_fact_values.empty?
293
-
294
- fact_vals = {}
295
- facts.each_index { |idx| fact_vals[facts[idx]] = valid_fact_values[idx] }
296
- fact_vals
297
- end
298
281
  end
299
282
  end
300
283
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AbideDevUtils
4
- VERSION = "0.14.1"
4
+ VERSION = "0.14.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abide_dev_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - abide-team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-08 00:00:00.000000000 Z
11
+ date: 2023-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri