iknow_params 2.2.4 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +31 -0
- data/.github/workflows/test.yml +54 -0
- data/Appraisals +11 -4
- data/gemfiles/activesupport_5_2.gemfile +1 -0
- data/gemfiles/activesupport_6_0.gemfile +1 -0
- data/gemfiles/activesupport_6_1.gemfile +9 -0
- data/gemfiles/activesupport_7_0.gemfile +9 -0
- data/iknow_params.gemspec +9 -6
- data/lib/iknow_params/serializer.rb +8 -1
- data/lib/iknow_params/version.rb +1 -1
- data/spec/unit/serializer_spec.rb +1 -0
- metadata +21 -19
- data/.circleci/config.yml +0 -103
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee414853a4b2107338e0f17ce3a81b9fbe12a5a0e9ac95e65664469fb5b3cbd9
|
4
|
+
data.tar.gz: 2d3c43707efeccea503065088c66ea75c6180d20f5f02e8d84260dc544bdabaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97841f46f550b5337bde1159408197bae0097ef6fc32f130ca35d9fd797a80430a1c506f2734d53d7929d4adc90fb344ef970f47bfacf4ed8cdfd5fcbcac1d20
|
7
|
+
data.tar.gz: 80127d5d23352dbc2e30a85a7dc396c08998fa52ca8f44e04d443b3f9bacb2b1c68e74d836060356dd73e37e678b3753b572d0eb21403d9c8d1eb46f3e1814b2
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Publish Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "master" ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
permissions:
|
12
|
+
contents: read
|
13
|
+
packages: write
|
14
|
+
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v3
|
17
|
+
- name: Set up Ruby 2.7
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.7
|
21
|
+
|
22
|
+
- name: Publish to RubyGems
|
23
|
+
run: |
|
24
|
+
mkdir -p $HOME/.gem
|
25
|
+
touch $HOME/.gem/credentials
|
26
|
+
chmod 0600 $HOME/.gem/credentials
|
27
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
28
|
+
gem build *.gemspec
|
29
|
+
gem push *.gem
|
30
|
+
env:
|
31
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,54 @@
|
|
1
|
+
name: Run Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches: "**"
|
6
|
+
|
7
|
+
permissions:
|
8
|
+
contents: read
|
9
|
+
checks: write
|
10
|
+
pull-requests: write
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
ruby-version: ['2.7', '3.0', '3.1', '3.2']
|
20
|
+
include:
|
21
|
+
- ruby-version: '2.7'
|
22
|
+
bundle-gemfile: gemfiles/activesupport_5_2.gemfile
|
23
|
+
- ruby-version: '3.0'
|
24
|
+
bundle-gemfile: gemfiles/activesupport_6_0.gemfile
|
25
|
+
- ruby-version: '3.1'
|
26
|
+
bundle-gemfile: gemfiles/activesupport_6_1.gemfile
|
27
|
+
- ruby-version: '3.2'
|
28
|
+
bundle-gemfile: gemfiles/activesupport_7_0.gemfile
|
29
|
+
|
30
|
+
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
31
|
+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.bundle-gemfile }}
|
32
|
+
|
33
|
+
steps:
|
34
|
+
- uses: actions/checkout@v3
|
35
|
+
- name: Set up Ruby
|
36
|
+
uses: ruby/setup-ruby@v1
|
37
|
+
with:
|
38
|
+
ruby-version: ${{ matrix.ruby-version }}
|
39
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
40
|
+
- name: Run tests
|
41
|
+
run: bundle exec rspec --profile 10 --format RspecJunitFormatter --out test_results/rspec.xml --format progress
|
42
|
+
- name: Upload result
|
43
|
+
uses: actions/upload-artifact@v3
|
44
|
+
if: always()
|
45
|
+
with:
|
46
|
+
name: rspec_${{ matrix.ruby-version }}.xml
|
47
|
+
path: test_results/rspec.xml
|
48
|
+
- name: Test Report
|
49
|
+
uses: dorny/test-reporter@v1
|
50
|
+
if: always()
|
51
|
+
with:
|
52
|
+
name: Rspec Tests - ${{ matrix.ruby-version }}
|
53
|
+
path: test_results/rspec.xml
|
54
|
+
reporter: java-junit
|
data/Appraisals
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
appraise
|
2
|
-
gem
|
1
|
+
appraise 'activesupport-5-2' do
|
2
|
+
gem 'activesupport', '~> 5.2.0'
|
3
|
+
gem 'rails', '~> 5.2.0'
|
3
4
|
end
|
4
5
|
|
5
|
-
appraise 'activesupport-6-0 do
|
6
|
-
gem 'activesupport', '~> 6.0.0
|
6
|
+
appraise 'activesupport-6-0' do
|
7
|
+
gem 'activesupport', '~> 6.0.0'
|
8
|
+
gem 'rails', '~> 6.0.0'
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise 'activesupport-7-0' do
|
12
|
+
gem 'activesupport', '~> 7.0.0'
|
13
|
+
gem 'rails', '~> 7.0.0'
|
7
14
|
end
|
data/iknow_params.gemspec
CHANGED
@@ -13,23 +13,26 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "http://github.com/iknow/iknow_params"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
+
spec.required_ruby_version = ">= 2.5"
|
17
|
+
spec.required_rubygems_version = ">= 2.5"
|
18
|
+
|
16
19
|
spec.files = `git ls-files -z`.split("\x0")
|
17
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
22
|
spec.require_paths = ["lib"]
|
20
23
|
|
21
|
-
spec.add_development_dependency "bundler", "~>
|
22
|
-
spec.add_development_dependency "rake", "~>
|
24
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
25
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
23
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
27
|
spec.add_development_dependency "sqlite3"
|
25
|
-
spec.add_development_dependency "actionpack", "> 5.0"
|
26
|
-
spec.add_development_dependency "rails", "> 5.0"
|
28
|
+
spec.add_development_dependency "actionpack", "> 5.2.0"
|
29
|
+
spec.add_development_dependency "rails", "> 5.2.0"
|
27
30
|
|
28
31
|
spec.add_development_dependency "byebug"
|
29
32
|
spec.add_development_dependency "appraisal"
|
30
33
|
spec.add_development_dependency "tzinfo-data"
|
31
34
|
|
32
|
-
spec.add_dependency "activesupport", "> 5.0"
|
35
|
+
spec.add_dependency "activesupport", "> 5.2.0"
|
33
36
|
spec.add_dependency "tzinfo"
|
34
|
-
spec.add_dependency "json-schema", "~>
|
37
|
+
spec.add_dependency "json-schema", "~> 3.0.0"
|
35
38
|
end
|
@@ -177,6 +177,8 @@ class IknowParams::Serializer
|
|
177
177
|
# Abstract serializer for ISO8601 dates and times
|
178
178
|
class ISO8601 < IknowParams::Serializer
|
179
179
|
def load(str)
|
180
|
+
raise TypeError.new unless str.is_a?(::String)
|
181
|
+
|
180
182
|
clazz.parse(str)
|
181
183
|
rescue TypeError, ArgumentError => _e
|
182
184
|
raise LoadError.new("Invalid type for conversion to #{clazz}")
|
@@ -235,7 +237,12 @@ class IknowParams::Serializer
|
|
235
237
|
class UUID < String
|
236
238
|
def load(str)
|
237
239
|
matches_type!(str, err: LoadError)
|
238
|
-
|
240
|
+
|
241
|
+
# UUIDs in Ruby are typically represented as lower case strings,
|
242
|
+
# for example, as returned by SecureRandom.uuid. To avoid surprises,
|
243
|
+
# and ensure that two equivalent UUIDs are equal to each other, we
|
244
|
+
# canonicalize any provided strings to lower case.
|
245
|
+
super.downcase
|
239
246
|
end
|
240
247
|
|
241
248
|
def matches_type?(str)
|
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.
|
4
|
+
version: 2.3.1
|
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: 2023-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 5.2.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 5.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rails
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 5.2.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 5.2.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: byebug
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - ">"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 5.2.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - ">"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 5.2.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: tzinfo
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 3.0.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 3.0.0
|
181
181
|
description: ''
|
182
182
|
email:
|
183
183
|
- ''
|
@@ -185,10 +185,10 @@ executables: []
|
|
185
185
|
extensions: []
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
|
-
- ".
|
188
|
+
- ".github/workflows/gem-push.yml"
|
189
|
+
- ".github/workflows/test.yml"
|
189
190
|
- ".gitignore"
|
190
191
|
- ".rspec"
|
191
|
-
- ".travis.yml"
|
192
192
|
- Appraisals
|
193
193
|
- Gemfile
|
194
194
|
- LICENSE.txt
|
@@ -196,6 +196,8 @@ files:
|
|
196
196
|
- Rakefile
|
197
197
|
- gemfiles/activesupport_5_2.gemfile
|
198
198
|
- gemfiles/activesupport_6_0.gemfile
|
199
|
+
- gemfiles/activesupport_6_1.gemfile
|
200
|
+
- gemfiles/activesupport_7_0.gemfile
|
199
201
|
- iknow_params.gemspec
|
200
202
|
- lib/iknow_params.rb
|
201
203
|
- lib/iknow_params/parser.rb
|
@@ -222,14 +224,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
222
224
|
requirements:
|
223
225
|
- - ">="
|
224
226
|
- !ruby/object:Gem::Version
|
225
|
-
version: '
|
227
|
+
version: '2.5'
|
226
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
229
|
requirements:
|
228
230
|
- - ">="
|
229
231
|
- !ruby/object:Gem::Version
|
230
|
-
version: '
|
232
|
+
version: '2.5'
|
231
233
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
234
|
+
rubygems_version: 3.1.6
|
233
235
|
signing_key:
|
234
236
|
specification_version: 4
|
235
237
|
summary: Rails parameter parser for iKnow.
|
data/.circleci/config.yml
DELETED
@@ -1,103 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
|
3
|
-
executors:
|
4
|
-
ruby:
|
5
|
-
parameters:
|
6
|
-
ruby-version:
|
7
|
-
type: string
|
8
|
-
default: "2.6"
|
9
|
-
gemfile:
|
10
|
-
type: string
|
11
|
-
default: "Gemfile"
|
12
|
-
docker:
|
13
|
-
- image: circleci/ruby:<< parameters.ruby-version >>
|
14
|
-
environment:
|
15
|
-
BUNDLE_JOBS: 3
|
16
|
-
BUNDLE_RETRY: 3
|
17
|
-
BUNDLE_PATH: vendor/bundle
|
18
|
-
RAILS_ENV: test
|
19
|
-
BUNDLE_GEMFILE: << parameters.gemfile >>
|
20
|
-
|
21
|
-
jobs:
|
22
|
-
test:
|
23
|
-
parameters:
|
24
|
-
ruby-version:
|
25
|
-
type: string
|
26
|
-
gemfile:
|
27
|
-
type: string
|
28
|
-
executor:
|
29
|
-
name: ruby
|
30
|
-
ruby-version: << parameters.ruby-version >>
|
31
|
-
gemfile: << parameters.gemfile >>
|
32
|
-
parallelism: 1
|
33
|
-
steps:
|
34
|
-
- checkout
|
35
|
-
|
36
|
-
- run:
|
37
|
-
# Remove the non-appraisal gemfile for safety: we never want to use it.
|
38
|
-
name: Prepare bundler
|
39
|
-
command: bundle -v
|
40
|
-
|
41
|
-
- run:
|
42
|
-
name: Compute a gemfile lock
|
43
|
-
command: bundle lock && cp "${BUNDLE_GEMFILE}.lock" /tmp/gem-lock
|
44
|
-
|
45
|
-
- restore_cache:
|
46
|
-
keys:
|
47
|
-
- iknow_params-<< parameters.ruby-version >>-{{ checksum "/tmp/gem-lock" }}
|
48
|
-
- iknow_params-
|
49
|
-
|
50
|
-
- run:
|
51
|
-
name: Bundle Install
|
52
|
-
command: bundle check || bundle install
|
53
|
-
|
54
|
-
- save_cache:
|
55
|
-
key: iknow_params-<< parameters.ruby-version >>-{{ checksum "/tmp/gem-lock" }}
|
56
|
-
paths:
|
57
|
-
- vendor/bundle
|
58
|
-
|
59
|
-
- run:
|
60
|
-
name: Run rspec
|
61
|
-
command: bundle exec rspec --profile 10 --format RspecJunitFormatter --out test_results/rspec.xml --format progress
|
62
|
-
|
63
|
-
- store_test_results:
|
64
|
-
path: test_results
|
65
|
-
|
66
|
-
publish:
|
67
|
-
executor: ruby
|
68
|
-
steps:
|
69
|
-
- checkout
|
70
|
-
- run:
|
71
|
-
name: Setup Rubygems
|
72
|
-
command: |
|
73
|
-
mkdir ~/.gem &&
|
74
|
-
echo -e "---\r\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials &&
|
75
|
-
chmod 0600 ~/.gem/credentials
|
76
|
-
- run:
|
77
|
-
name: Publish to Rubygems
|
78
|
-
command: |
|
79
|
-
gem build iknow_params.gemspec
|
80
|
-
gem push iknow_params-*.gem
|
81
|
-
|
82
|
-
workflows:
|
83
|
-
version: 2.1
|
84
|
-
build:
|
85
|
-
jobs:
|
86
|
-
- test:
|
87
|
-
name: 'ruby 2.5 ActiveSupport 5.2'
|
88
|
-
ruby-version: "2.5"
|
89
|
-
gemfile: gemfiles/activesupport_5_2.gemfile
|
90
|
-
- test:
|
91
|
-
name: 'ruby 2.6 ActiveSupport 5.2'
|
92
|
-
ruby-version: "2.6"
|
93
|
-
gemfile: gemfiles/activesupport_5_2.gemfile
|
94
|
-
- test:
|
95
|
-
name: 'ruby 2.6 ActiveSupport 6.0'
|
96
|
-
ruby-version: "2.6"
|
97
|
-
gemfile: gemfiles/activesupport_6_0.gemfile
|
98
|
-
- publish:
|
99
|
-
filters:
|
100
|
-
branches:
|
101
|
-
only: master
|
102
|
-
tags:
|
103
|
-
ignore: /.*/
|