iknow_params 2.2.1 → 2.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a160f24a66c754ac8a99c82733ab62cbd90a9efb1cb774caa6ee4e0a99209e9
|
4
|
+
data.tar.gz: add02989afa3c4e89fcbc4e654da2111ee12e9a5b1058964a5cdcc73fd680f2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9452357f96359d582d9248386432b68ce1281f73c8c428d5e474417801b81ce0159fdbc422bc12f84a0ca6ebd2093644ebf00fae3712f97c42b4b86d105d359d
|
7
|
+
data.tar.gz: 9b36e47ffc50792f5d5e67889bc55041ab783509f54a49d357c9d07bb32cac977a67d41ec7948ee16c1de0a661e2a05d6209e359e678051e3b73295c32200288
|
data/.circleci/config.yml
CHANGED
@@ -92,9 +92,9 @@ workflows:
|
|
92
92
|
ruby-version: "2.6"
|
93
93
|
gemfile: gemfiles/activesupport_5_2.gemfile
|
94
94
|
- test:
|
95
|
-
name: 'ruby 2.6 ActiveSupport 6.0
|
95
|
+
name: 'ruby 2.6 ActiveSupport 6.0'
|
96
96
|
ruby-version: "2.6"
|
97
|
-
gemfile: gemfiles/
|
97
|
+
gemfile: gemfiles/activesupport_6_0.gemfile
|
98
98
|
- publish:
|
99
99
|
filters:
|
100
100
|
branches:
|
data/Appraisals
CHANGED
@@ -344,12 +344,12 @@ class IknowParams::Serializer
|
|
344
344
|
# case-normalized on parse.
|
345
345
|
class StringEnum < IknowParams::Serializer
|
346
346
|
def initialize(*members)
|
347
|
-
@member_set = members.map(
|
347
|
+
@member_set = members.map { |s| normalize(s) }.to_set.freeze
|
348
348
|
super(nil)
|
349
349
|
end
|
350
350
|
|
351
351
|
def load(str)
|
352
|
-
val = str.to_s
|
352
|
+
val = normalize(str.to_s)
|
353
353
|
matches_type!(val, err: LoadError)
|
354
354
|
val
|
355
355
|
end
|
@@ -357,5 +357,15 @@ class IknowParams::Serializer
|
|
357
357
|
def matches_type?(str)
|
358
358
|
str.is_a?(::String) && @member_set.include?(str)
|
359
359
|
end
|
360
|
+
|
361
|
+
def normalize(str)
|
362
|
+
str.downcase
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
class CaseSensitiveStringEnum < StringEnum
|
367
|
+
def normalize(str)
|
368
|
+
str
|
369
|
+
end
|
360
370
|
end
|
361
371
|
end
|
data/lib/iknow_params/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iknow_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dev@iknow.jp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -181,7 +181,7 @@ files:
|
|
181
181
|
- README.md
|
182
182
|
- Rakefile
|
183
183
|
- gemfiles/activesupport_5_2.gemfile
|
184
|
-
- gemfiles/
|
184
|
+
- gemfiles/activesupport_6_0.gemfile
|
185
185
|
- iknow_params.gemspec
|
186
186
|
- lib/iknow_params.rb
|
187
187
|
- lib/iknow_params/parser.rb
|