helm-wrapper 1.4.0 → 1.5.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: adfede6ac33bcec8e6948dc9a0501b2ef86c36b985800badb621e64345d697d4
4
- data.tar.gz: f2c9b7a4746def6c1e9c614710e3c5ba7cedf4bbc6797cbd75f319c6c4a09d12
3
+ metadata.gz: b1d3f972839e1f9e7abd290193f07d57517d5ce589056e880c06d464bdd7bf37
4
+ data.tar.gz: 9bad65a1005854b57ccdfb14cea4f7e2c1305eb4669fb4d65c17b72e5004c27c
5
5
  SHA512:
6
- metadata.gz: 947a1995f242c0a4dd5dca6b931f2d5acf0fc55488dec0a5df1399a9d110e729bd5b46d607eb9cb88a01e5e93c29088bb2cd205834f17cb0f7cb015f4d4c75a7
7
- data.tar.gz: 87647c76ea61672ded735f840d7a3d9bf3a42587d74b3c7f34196adc99894c0ea47d04ef94ba3ac8bed4c2e078c24346f6ff77ae6d1f55b1e591520311e72eaf
6
+ metadata.gz: ecf5901a01a7dccbb485db2d25467fec5759f243a8bd96d9ff3f0e22f7862f0e388d710190c95ab580cbdde27176923d3eeaf3573ebfc5571d779956a58fbf14
7
+ data.tar.gz: 81c011c1774a3649ecf4a5a68b3bca0f5769760a73455ac656aa624639cea78a1b99f7282cf64cd3a1f4a7dabd41ff50d8fcc7555fc5fe821f7416036008709f
@@ -37,7 +37,7 @@ module HelmWrapper
37
37
  core[:namespace] = nil
38
38
  core[:release] = release
39
39
 
40
- user = cleanse(variables: identifiers, reserved: core.keys)
40
+ user = cleanse(variables: identifiers, reserved: core.keys, downcase: true)
41
41
 
42
42
  begin
43
43
  core[:namespace] = namespace % user
@@ -107,17 +107,20 @@ module HelmWrapper
107
107
 
108
108
  ###############################################################################
109
109
 
110
- def cleanse(variables:, reserved:)
110
+ def cleanse(variables:, reserved:, downcase: false)
111
111
  result = Hash.new
112
112
 
113
113
  variables.keys.each do |key|
114
114
  logger.fatal("Could not clean variables hash. All keys MUST be strings!") unless key.kind_of?(String)
115
- logger.fatal("Could not clean variables hash, key: #{key.downcase} is reserved or already in use and cannot be used!") if reserved.include?(key.downcase.to_sym)
116
- logger.fatal("Could not clean variables hash, duplicate key found: #{key.downcase}!") if result.key?(key.downcase.to_sym)
117
- logger.fatal("Could not clean variables hash, value for: #{key.downcase} is not a string!") unless variables[key].kind_of?(String)
118
- logger.fatal("Could not clean variables hash, value for: #{key.downcase} is empty!") if variables[key].strip.empty?
119
115
 
120
- result[key.downcase.to_sym] = variables[key].strip
116
+ sym = downcase ? key.downcase.to_sym : key.to_sym
117
+
118
+ logger.fatal("Could not clean variables hash, key: #{sym.to_s} is reserved or already in use and cannot be used!") if reserved.include?(sym)
119
+ logger.fatal("Could not clean variables hash, duplicate key found: #{sym.to_s}!") if result.key?(sym)
120
+ logger.fatal("Could not clean variables hash, value for: #{sym.to_s} is not a string!") unless variables[key].kind_of?(String)
121
+ logger.fatal("Could not clean variables hash, value for: #{sym.to_s} is empty!") if variables[key].strip.empty?
122
+
123
+ result[sym] = variables[key].strip
121
124
  end
122
125
 
123
126
  return result
@@ -4,7 +4,7 @@ module HelmWrapper
4
4
 
5
5
  ###############################################################################
6
6
 
7
- VERSION = "1.4.0"
7
+ VERSION = "1.5.0"
8
8
 
9
9
  ###############################################################################
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helm-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lees
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake