rubyconfig-vault 1.0.1 → 1.0.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: 46de173dcd36067470c87796ac1767b87b0dfa8a45deccab555e3f4e46f27eba
4
- data.tar.gz: a46241218beef3db50686fdd504804c0996b3a773dc7d5fdf0c6cffe2250ae8e
3
+ metadata.gz: 63279ad2f29fabd8006dd8bdf3a69e49dabd2a1d5e3f89c1c695c9e6528f5154
4
+ data.tar.gz: 734327aae2db0747633a5a06101e2c2117ad54b0b441011bf4d58348da871c46
5
5
  SHA512:
6
- metadata.gz: 2714a2880f99e0adfa77bbcdfb1b0bc00fe26ecc087846d47dce9d1c644f37c39ce459c1474810f4d6b9200094b197dab593f80e26023643854eb27d3b828859
7
- data.tar.gz: d31a1275c69520b68ed8d3c7bb6bb68fbd852ac50e8337899ab310114c76d4086697407067cfb13d6c391b98bb3f96fbcf40202bb7a8a322a13a4176c35962b5
6
+ metadata.gz: 4b6aac24bcb3781bae89ef0bc3e77fe5da3f5ada28308c711e5f8117e193cedcf12aaf5a6576ab080521f138325052c16c5e2246011fb086b38c7407cd32a839
7
+ data.tar.gz: 8455068a25f114a7a9a430e8daf25421c253f39788c673bcfd996ba208bfee086f7c5fb7d3dfd0c2f93c7349eb6792d4851b082c0753b60ebf729c04db2f2379
@@ -27,6 +27,7 @@ module Config
27
27
  @root = client_opts.delete(:root)
28
28
  @flatten = client_opts.delete(:flatten)
29
29
  @paths << client_opts.delete(:paths) if client_opts.key?(:paths)
30
+ @map = {}
30
31
  @paths.map! do |p|
31
32
  if p.is_a?(Array)
32
33
  p
@@ -50,6 +51,13 @@ module Config
50
51
  @paths << [path, root]
51
52
  end
52
53
 
54
+ # Re-map individual key names
55
+ #
56
+ # @param hsh [Hash] mappings for keys
57
+ def map(hsh)
58
+ @map = hsh
59
+ end
60
+
53
61
  # Remove added paths
54
62
  def clear_paths
55
63
  @paths = []
@@ -95,8 +103,9 @@ module Config
95
103
  query_path, idx, parent = stack.pop
96
104
  sp = subpaths[idx]
97
105
  if sp.nil? || sp.eql?('*')
98
- data = client_ops.read(query_path)&.data
99
- parent.merge!(data || {})
106
+ data = client_ops.read(query_path)&.data || {}
107
+ parent.merge!(data)
108
+ parent.transform_keys! { |key| @map[key] || key }
100
109
  parent.compact!
101
110
  end
102
111
 
@@ -1,5 +1,5 @@
1
1
  module Config
2
2
  module Vault
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyconfig-vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Young