sinatra-validation 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa3a3b73cd49ac6a0b7b6e8aa3c4398e40dae9abb464a59ecc2dec9952ac3f23
4
- data.tar.gz: 1d4a20b3554ed689d80b4dd524e1fd6aebf6e315c7e5de45c905f3d7faae379c
3
+ metadata.gz: e6a851a8606cd5ce9ac0f3134b79baea64e2ec1e19f5465c2d286ad1f0bd29b9
4
+ data.tar.gz: c2eabc80d34f383250e49d8d677205da9232b9b235713c38b998e36de47e7253
5
5
  SHA512:
6
- metadata.gz: 54e9deffe50aa5f7e3b5a660a84b777881fc1829083a0d8f16c02cd2d204d3072d835f937d4e2013643b258883d49461f3343678e0bda3d10b1ac47a2c5bc195
7
- data.tar.gz: b542a570e3ea3a817230c759630f49a37b22ce34b8c12e3019377acc0add144446313eac1b23f647e9caac12f6457be5253d1088e37956f62e621b7922c631c6
6
+ metadata.gz: 19a7e50006a9117db3edcc5bb245e6da91aee562b2c8d617be856e73add4ff090863765e8621ec5b0fa61df36b12181421c0c3d7ab5bd6554a4f0c019b7457f2
7
+ data.tar.gz: a47a509e600fadecc6f8c6689bbc4516e32b71e297a58cde4139fa3b49df44c521cbd83f6c3cd1bd1bb3cdd29d165134fc0d55ec53d95b8e5f967941f680af24
data/.circleci/config.yml CHANGED
@@ -3,18 +3,18 @@ version: 2
3
3
  jobs:
4
4
  build:
5
5
  docker:
6
- - image: circleci/ruby:2.6.6
6
+ - image: ruby:3.3.0
7
7
 
8
8
  working_directory: ~/repo
9
9
 
10
10
  steps:
11
11
  - checkout
12
- - run:
12
+ - run:
13
13
  name: install deps
14
14
  command: |
15
15
  bundle install --jobs=4 --retry=3 --path vendor/bundle
16
16
 
17
- - run:
17
+ - run:
18
18
  name: run tests
19
19
  command: |
20
20
  bundle exec rake spec
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /doc/
7
7
  /pkg/
8
8
  /spec/reports/
9
+ /vendor/
9
10
  /tmp/
10
11
 
11
12
  # rspec failure tracking
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.6
1
+ 3.3.3
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
- ruby '2.6.6'
2
+ ruby '3.3.3'
3
3
 
4
4
  # Specify your gem's dependencies in sinatra-validation.gemspec
5
5
  gemspec
data/example/app.rb CHANGED
@@ -59,6 +59,19 @@ class Application < Sinatra::Base
59
59
  end
60
60
  end
61
61
 
62
+ get '/rule/:value' do
63
+ validates do
64
+ params do
65
+ optional(:value).filled(:str?)
66
+ end
67
+ rule(:value) do
68
+ key.failure('Invalid param') unless value.match?(/^[a-z]+$/)
69
+ end
70
+ end
71
+
72
+ 'ok'
73
+ end
74
+
62
75
  get '/filter' do
63
76
  validates filter_unpermitted_params: true do
64
77
  params do
@@ -76,4 +89,5 @@ class Application < Sinatra::Base
76
89
  end
77
90
  result.params.map{|k, v| "#{k}=#{v}"}.join(' ')
78
91
  end
92
+
79
93
  end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module Validation
3
- VERSION = "0.3.2"
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
@@ -21,12 +21,12 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_dependency 'sinatra', '~> 2.1.0'
25
- spec.add_dependency 'rack', '>= 2.0.6'
26
- spec.add_dependency 'dry-validation', '~> 1.3'
24
+ spec.add_dependency 'sinatra', '~> 4.0.0'
25
+ spec.add_dependency 'rack', '>= 3.0.9'
26
+ spec.add_dependency 'dry-validation', '~> 1.10'
27
27
 
28
- spec.add_development_dependency "rake", "~> 10.0"
29
- spec.add_development_dependency "rspec", "~> 3.0"
28
+ spec.add_development_dependency "rake", "~> 13.1"
29
+ spec.add_development_dependency "rspec", "~> 3.13"
30
30
  spec.add_development_dependency "rack-contrib"
31
31
  spec.add_development_dependency "rack-test"
32
32
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - IzumiSy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-11 00:00:00.000000000 Z
11
+ date: 2024-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -16,70 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0
19
+ version: 4.0.0
20
20
  type: :runtime
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: 2.1.0
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.6
33
+ version: 3.0.9
34
34
  type: :runtime
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: 2.0.6
40
+ version: 3.0.9
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dry-validation
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '1.10'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '1.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '3.13'
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: '3.0'
82
+ version: '3.13'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rack-contrib
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  requirements: []
169
- rubygems_version: 3.0.3
169
+ rubygems_version: 3.5.11
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: '"Sinatra extension for request parameter validation"'