kafo 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kafo/param.rb +14 -2
  3. data/lib/kafo/version.rb +1 -1
  4. metadata +2 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db9b3b40107fa2d91237c80a6b8446453dcd27e2
4
- data.tar.gz: 261a13dacf89eb0c60de97c695b18dc6d85f12f6
3
+ metadata.gz: 6d72a4ee27bfb7b43960efdca85631bf83423fc0
4
+ data.tar.gz: 80f0f06eaf07cabde8a67df2d5e231511fc2d50f
5
5
  SHA512:
6
- metadata.gz: 387764db060a0772afc3e5a4043f7eba8ac308e2953463f8cae1b45467f82c8439a9cd44915b6b05d506aa2ea6cddd93851e3c19e5d0f787ddb6cf5234f324ee
7
- data.tar.gz: 1d68fbbf5ac9bb4108cbb7778bfcb73a9410cad386c567c390269b80afbecf58349f2c166f799e46677a0bae8f8b1c63884b1d95d6e0a4256a27386092b17b64
6
+ metadata.gz: dc3d55c99f389d35e425e5fd9ede4cc09dd559ca84a51c6fea66fe7fef49168240424b6e7d1756404b9fab4e9a9dca16769d612327fe25bbd9a33f626702c9c1
7
+ data.tar.gz: 2b6d1cecef96812457b9749e65e1b84b4cba5fa772d489fbdc0a11cb851dcc4dca0287b0f08bd6e861879e8167c15ea4fe0bda09facbbc0d878513ba3c013f45
data/lib/kafo/param.rb CHANGED
@@ -26,8 +26,7 @@ module Kafo
26
26
 
27
27
  def value=(value)
28
28
  @value_set = true
29
- value = value.to_s if value.is_a?(::HighLine::String) # don't persist highline extensions
30
- @value = value
29
+ @value = normalize_value(value)
31
30
  end
32
31
 
33
32
  def unset_value
@@ -144,6 +143,19 @@ module Kafo
144
143
  arg == :undef ? nil : arg
145
144
  end
146
145
  end
146
+
147
+ def normalize_value(value)
148
+ case value
149
+ when ::HighLine::String # don't persist highline extensions
150
+ value.to_s
151
+ when Array
152
+ value.map { |v| normalize_value(v) }
153
+ when Hash
154
+ Hash[value.map { |k,v| [normalize_value(k), normalize_value(v)] }]
155
+ else
156
+ value
157
+ end
158
+ end
147
159
  end
148
160
  end
149
161
 
data/lib/kafo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
3
  PARSER_CACHE_VERSION = 1
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: 0.1.1
125
- - !ruby/object:Gem::Dependency
126
- name: puppet
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "<"
130
- - !ruby/object:Gem::Version
131
- version: 4.0.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "<"
137
- - !ruby/object:Gem::Version
138
- version: 4.0.0
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: logging
141
127
  requirement: !ruby/object:Gem::Requirement