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: 72ed5066cf3acd50bc02597d9731adb68cc5f13c1c672a74ed0e73d38e30721a
4
- data.tar.gz: d818d2b61fa52eaafe28522c50cf4d2ff39c1c97048a58e8f3d9ae1c4e4d5212
3
+ metadata.gz: 7a160f24a66c754ac8a99c82733ab62cbd90a9efb1cb774caa6ee4e0a99209e9
4
+ data.tar.gz: add02989afa3c4e89fcbc4e654da2111ee12e9a5b1058964a5cdcc73fd680f2c
5
5
  SHA512:
6
- metadata.gz: 0540c5cdb77e348a212628f197003885ece7296ca4a2bcab9d98c29c8d7719ed893178fa6ff7126dba2150881419c7c5282579856f9b7cd19ab64b0baff46d80
7
- data.tar.gz: 4ff81fb705909a6a793b5ac1f436ff4a4cfc97acb00aab9767725e73c7cec1bbf0f91fe1be31d462fe4cd9124617cee9b10f135f007310cfc062bb65ef94aed3
6
+ metadata.gz: 9452357f96359d582d9248386432b68ce1281f73c8c428d5e474417801b81ce0159fdbc422bc12f84a0ca6ebd2093644ebf00fae3712f97c42b4b86d105d359d
7
+ data.tar.gz: 9b36e47ffc50792f5d5e67889bc55041ab783509f54a49d357c9d07bb32cac977a67d41ec7948ee16c1de0a661e2a05d6209e359e678051e3b73295c32200288
@@ -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-beta'
95
+ name: 'ruby 2.6 ActiveSupport 6.0'
96
96
  ruby-version: "2.6"
97
- gemfile: gemfiles/activesupport_6_0_beta.gemfile
97
+ gemfile: gemfiles/activesupport_6_0.gemfile
98
98
  - publish:
99
99
  filters:
100
100
  branches:
data/Appraisals CHANGED
@@ -2,6 +2,6 @@ appraise "activesupport-5-2" do
2
2
  gem "activesupport", "~> 5.2.0"
3
3
  end
4
4
 
5
- appraise 'activesupport-6-0-beta' do
6
- gem 'activesupport', '~> 6.0.0.beta'
5
+ appraise 'activesupport-6-0 do
6
+ gem 'activesupport', '~> 6.0.0"
7
7
  end
@@ -3,6 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rspec_junit_formatter"
6
- gem "activesupport", "~> 6.0.0.beta"
6
+ gem "activesupport", "~> 6.0.0"
7
7
 
8
8
  gemspec path: "../"
@@ -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(&:downcase).to_set.freeze
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.downcase
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IknowParams
4
- VERSION = "2.2.1"
4
+ VERSION = '2.2.2'
5
5
  end
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.1
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: 2019-04-08 00:00:00.000000000 Z
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/activesupport_6_0_beta.gemfile
184
+ - gemfiles/activesupport_6_0.gemfile
185
185
  - iknow_params.gemspec
186
186
  - lib/iknow_params.rb
187
187
  - lib/iknow_params/parser.rb