dry-validation 1.8.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/LICENSE +1 -1
- data/dry-validation.gemspec +3 -2
- data/lib/dry/validation/config.rb +0 -3
- data/lib/dry/validation/contract/class_interface.rb +0 -7
- data/lib/dry/validation/contract.rb +4 -11
- data/lib/dry/validation/evaluator.rb +0 -3
- data/lib/dry/validation/extensions/predicates_as_macros.rb +0 -3
- data/lib/dry/validation/macro.rb +0 -1
- data/lib/dry/validation/macros.rb +0 -1
- data/lib/dry/validation/message.rb +0 -5
- data/lib/dry/validation/message_set.rb +0 -3
- data/lib/dry/validation/messages/resolver.rb +0 -3
- data/lib/dry/validation/result.rb +0 -3
- data/lib/dry/validation/rule.rb +0 -3
- data/lib/dry/validation/values.rb +0 -1
- data/lib/dry/validation/version.rb +1 -1
- data/lib/dry/validation.rb +25 -3
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb13f4dba2e8837c0cff3c3d092eacc87c29c367286f6e16f37c4b5d78179066
|
4
|
+
data.tar.gz: 66196d258e68914b4546dcc20033e74627f2c738fcbeadbe6d4bfff746861cc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ccea2694b25be64dd68f01c6d9d554c20ae7992ffe78dbf2d483e5d502cdcc2bc3884f567da8d1d303a3b8fa71fa42c85b1a63977c5bef2b42d1496585228f4
|
7
|
+
data.tar.gz: e95cd0ce0d5fdcd583b9edb023c1ae6d0797ab5bcfad1816c1a2b9d989c50fea90b66699c89bc5aedeb09483315b8c5d33696cec2e1662e06c7cadff162e9e22
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.9.0 2022-10-15
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Duplicated keys mishandling in rule evaluation (issue #676 fixed via #711) (@mereghost)
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- Use Zeitwerk for auto-loading (via #715) (@solnic)
|
13
|
+
|
14
|
+
[Compare v1.8.1...v1.9.0](https://github.com/dry-rb/dry-validation/compare/v1.8.1...v1.9.0)
|
15
|
+
|
3
16
|
## 1.8.1 2022-05-28
|
4
17
|
|
5
18
|
|
data/LICENSE
CHANGED
data/dry-validation.gemspec
CHANGED
@@ -31,9 +31,10 @@ Gem::Specification.new do |spec|
|
|
31
31
|
# to update dependencies edit project.yml
|
32
32
|
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
33
33
|
spec.add_runtime_dependency "dry-container", "~> 0.7", ">= 0.7.1"
|
34
|
-
spec.add_runtime_dependency "dry-core", "~> 0.
|
34
|
+
spec.add_runtime_dependency "dry-core", "~> 0.9", ">= 0.9"
|
35
35
|
spec.add_runtime_dependency "dry-initializer", "~> 3.0"
|
36
|
-
spec.add_runtime_dependency "dry-schema", "~> 1.
|
36
|
+
spec.add_runtime_dependency "dry-schema", "~> 1.11", ">= 1.11.0"
|
37
|
+
spec.add_runtime_dependency "zeitwerk", "~> 2.6"
|
37
38
|
|
38
39
|
spec.add_development_dependency "bundler"
|
39
40
|
spec.add_development_dependency "rake"
|
@@ -1,13 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/schema"
|
4
|
-
require "dry/schema/messages"
|
5
|
-
require "dry/schema/path"
|
6
|
-
require "dry/schema/key_map"
|
7
|
-
|
8
3
|
require "dry/validation/constants"
|
9
|
-
require "dry/validation/macros"
|
10
|
-
require "dry/validation/schema_ext"
|
11
4
|
|
12
5
|
module Dry
|
13
6
|
module Validation
|
@@ -2,17 +2,9 @@
|
|
2
2
|
|
3
3
|
require "concurrent/map"
|
4
4
|
|
5
|
-
require "dry/core/equalizer"
|
6
5
|
require "dry/initializer"
|
7
|
-
require "dry/schema/path"
|
8
|
-
|
9
|
-
require "dry/validation/config"
|
10
6
|
require "dry/validation/constants"
|
11
|
-
require "dry/validation/
|
12
|
-
require "dry/validation/evaluator"
|
13
|
-
require "dry/validation/messages/resolver"
|
14
|
-
require "dry/validation/result"
|
15
|
-
require "dry/validation/contract/class_interface"
|
7
|
+
require "dry/validation/schema_ext"
|
16
8
|
|
17
9
|
module Dry
|
18
10
|
module Validation
|
@@ -140,8 +132,9 @@ module Dry
|
|
140
132
|
|
141
133
|
path
|
142
134
|
.to_a[0..-2]
|
143
|
-
.
|
144
|
-
|
135
|
+
.each_with_index
|
136
|
+
.any? { |_key, index|
|
137
|
+
curr_path = Schema::Path[path.keys[0..index]]
|
145
138
|
|
146
139
|
return false unless result.schema_error?(curr_path)
|
147
140
|
|
data/lib/dry/validation/macro.rb
CHANGED
data/lib/dry/validation/rule.rb
CHANGED
data/lib/dry/validation.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "zeitwerk"
|
4
|
+
|
5
|
+
require "dry/core"
|
6
|
+
require "dry/schema"
|
7
|
+
|
3
8
|
require "dry/validation/constants"
|
4
|
-
require "dry/validation/contract"
|
5
|
-
require "dry/validation/macros"
|
6
9
|
|
7
10
|
# Main namespace
|
8
11
|
#
|
@@ -13,7 +16,22 @@ module Dry
|
|
13
16
|
# @api public
|
14
17
|
module Validation
|
15
18
|
extend Dry::Core::Extensions
|
16
|
-
|
19
|
+
|
20
|
+
def self.loader
|
21
|
+
@loader ||= Zeitwerk::Loader.new.tap do |loader|
|
22
|
+
root = File.expand_path("..", __dir__)
|
23
|
+
loader.tag = "dry-validation"
|
24
|
+
loader.inflector = Zeitwerk::GemInflector.new("#{root}/dry-validation.rb")
|
25
|
+
loader.push_dir(root)
|
26
|
+
loader.ignore(
|
27
|
+
"#{root}/dry-validation.rb",
|
28
|
+
"#{root}/dry/validation/schema_ext.rb",
|
29
|
+
"#{root}/dry/validation/{constants,errors,version}.rb",
|
30
|
+
"#{root}/dry/validation/extensions"
|
31
|
+
)
|
32
|
+
loader.inflector.inflect("dsl" => "DSL")
|
33
|
+
end
|
34
|
+
end
|
17
35
|
|
18
36
|
register_extension(:monads) do
|
19
37
|
require "dry/validation/extensions/monads"
|
@@ -56,5 +74,9 @@ module Dry
|
|
56
74
|
def self.macros
|
57
75
|
Macros
|
58
76
|
end
|
77
|
+
|
78
|
+
loader.setup
|
79
|
+
|
80
|
+
extend Macros::Registrar
|
59
81
|
end
|
60
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -50,20 +50,20 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.9'
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '0.
|
56
|
+
version: '0.9'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '0.
|
63
|
+
version: '0.9'
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '0.
|
66
|
+
version: '0.9'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: dry-initializer
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,20 +84,34 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '1.
|
87
|
+
version: '1.11'
|
88
88
|
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 1.
|
90
|
+
version: 1.11.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: '1.
|
97
|
+
version: '1.11'
|
98
98
|
- - ">="
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: 1.
|
100
|
+
version: 1.11.0
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: zeitwerk
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - "~>"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '2.6'
|
108
|
+
type: :runtime
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - "~>"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '2.6'
|
101
115
|
- !ruby/object:Gem::Dependency
|
102
116
|
name: bundler
|
103
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,7 +196,7 @@ metadata:
|
|
182
196
|
changelog_uri: https://github.com/dry-rb/dry-validation/blob/main/CHANGELOG.md
|
183
197
|
source_code_uri: https://github.com/dry-rb/dry-validation
|
184
198
|
bug_tracker_uri: https://github.com/dry-rb/dry-validation/issues
|
185
|
-
post_install_message:
|
199
|
+
post_install_message:
|
186
200
|
rdoc_options: []
|
187
201
|
require_paths:
|
188
202
|
- lib
|
@@ -197,8 +211,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
211
|
- !ruby/object:Gem::Version
|
198
212
|
version: '0'
|
199
213
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
201
|
-
signing_key:
|
214
|
+
rubygems_version: 3.1.6
|
215
|
+
signing_key:
|
202
216
|
specification_version: 4
|
203
217
|
summary: Validation library
|
204
218
|
test_files: []
|