dry-schema 1.10.6 → 1.11.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 +9 -0
- data/dry-schema.gemspec +5 -4
- data/lib/dry/schema/compiler.rb +0 -4
- data/lib/dry/schema/config.rb +0 -3
- data/lib/dry/schema/dsl.rb +0 -16
- data/lib/dry/schema/extensions/hints.rb +4 -4
- data/lib/dry/schema/extensions/struct.rb +0 -4
- data/lib/dry/schema/json.rb +0 -2
- data/lib/dry/schema/key_map.rb +0 -3
- data/lib/dry/schema/macros/array.rb +0 -2
- data/lib/dry/schema/macros/core.rb +0 -3
- data/lib/dry/schema/macros/dsl.rb +0 -6
- data/lib/dry/schema/macros/each.rb +0 -3
- data/lib/dry/schema/macros/filled.rb +0 -2
- data/lib/dry/schema/macros/hash.rb +0 -2
- data/lib/dry/schema/macros/key.rb +0 -4
- data/lib/dry/schema/macros/maybe.rb +0 -2
- data/lib/dry/schema/macros/optional.rb +0 -2
- data/lib/dry/schema/macros/required.rb +0 -2
- data/lib/dry/schema/macros/schema.rb +0 -2
- data/lib/dry/schema/macros/value.rb +0 -3
- data/lib/dry/schema/message/or/multi_path.rb +0 -3
- data/lib/dry/schema/message/or/single_path.rb +0 -2
- data/lib/dry/schema/message/or.rb +0 -3
- data/lib/dry/schema/message.rb +0 -4
- data/lib/dry/schema/message_compiler/visitor_opts.rb +0 -1
- data/lib/dry/schema/message_compiler.rb +0 -5
- data/lib/dry/schema/messages/abstract.rb +0 -3
- data/lib/dry/schema/messages/i18n.rb +1 -1
- data/lib/dry/schema/messages/yaml.rb +0 -4
- data/lib/dry/schema/messages.rb +0 -5
- data/lib/dry/schema/params.rb +0 -2
- data/lib/dry/schema/predicate_inferrer.rb +0 -2
- data/lib/dry/schema/predicate_registry.rb +0 -3
- data/lib/dry/schema/primitive_inferrer.rb +0 -2
- data/lib/dry/schema/processor.rb +0 -9
- data/lib/dry/schema/processor_steps.rb +0 -2
- data/lib/dry/schema/result.rb +0 -2
- data/lib/dry/schema/rule_applier.rb +0 -5
- data/lib/dry/schema/step.rb +0 -1
- data/lib/dry/schema/trace.rb +0 -4
- data/lib/dry/schema/version.rb +1 -1
- data/lib/dry/schema.rb +29 -6
- metadata +26 -19
- data/lib/dry/schema/macros.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ac964a43295c0e7abbac3d3afff822e81c3116264c91ca134e6b2eaa0a93e36
|
4
|
+
data.tar.gz: 954e729bfc708c26bbbe9ceee51a5281bbe27323d14be76af3197527c19b47e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c52027ad05138f792f6dc0fe0e10b40c9b11897566f87defefd9049ea2d4d650ed636e46a15ed9912e83061881927299760327c87e5143d0c3b53c7e600d85ae
|
7
|
+
data.tar.gz: 6f0aa01b4f84c52a4065a800e8503e7cd500c23beca54ceba91d1179f1a2644abd639a736b41c149ffcb9b392a76d2d70b3f91b0ad7a6b98b718421156c5128f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.11.0 2022-10-15
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
|
8
|
+
- Use zeitwerk for auto-loading which speeds up requires (via #427) (@flash-gordon + @solnic)
|
9
|
+
|
10
|
+
[Compare v1.10.6...v1.11.0](https://github.com/dry-rb/dry-schema/compare/v1.10.6...v1.11.0)
|
11
|
+
|
3
12
|
## 1.10.6 2022-10-01
|
4
13
|
|
5
14
|
|
data/dry-schema.gemspec
CHANGED
@@ -35,11 +35,12 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
# to update dependencies edit project.yml
|
37
37
|
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
38
|
-
spec.add_runtime_dependency "dry-configurable", "~> 0.
|
39
|
-
spec.add_runtime_dependency "dry-core", "~> 0.
|
38
|
+
spec.add_runtime_dependency "dry-configurable", "~> 0.16"
|
39
|
+
spec.add_runtime_dependency "dry-core", "~> 0.9", ">= 0.9"
|
40
40
|
spec.add_runtime_dependency "dry-initializer", "~> 3.0"
|
41
|
-
spec.add_runtime_dependency "dry-logic", "~> 1.
|
42
|
-
spec.add_runtime_dependency "dry-types", "~> 1.
|
41
|
+
spec.add_runtime_dependency "dry-logic", "~> 1.3"
|
42
|
+
spec.add_runtime_dependency "dry-types", "~> 1.6"
|
43
|
+
spec.add_runtime_dependency "zeitwerk", "~> 2.6"
|
43
44
|
|
44
45
|
spec.add_development_dependency "bundler"
|
45
46
|
spec.add_development_dependency "rake"
|
data/lib/dry/schema/compiler.rb
CHANGED
data/lib/dry/schema/config.rb
CHANGED
data/lib/dry/schema/dsl.rb
CHANGED
@@ -1,23 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/initializer"
|
4
|
-
require "dry/logic"
|
5
|
-
|
6
4
|
require "dry/schema/constants"
|
7
|
-
require "dry/schema/path"
|
8
|
-
require "dry/schema/config"
|
9
|
-
require "dry/schema/compiler"
|
10
|
-
require "dry/schema/types"
|
11
|
-
require "dry/schema/macros"
|
12
|
-
|
13
|
-
require "dry/schema/processor"
|
14
|
-
require "dry/schema/processor_steps"
|
15
|
-
require "dry/schema/key_map"
|
16
|
-
require "dry/schema/key_coercer"
|
17
|
-
require "dry/schema/key_validator"
|
18
|
-
require "dry/schema/value_coercer"
|
19
|
-
require "dry/schema/rule_applier"
|
20
|
-
require "dry/schema/types_merger"
|
21
5
|
|
22
6
|
module Dry
|
23
7
|
module Schema
|
@@ -1,9 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/schema/compiler"
|
4
|
-
require "dry/schema/message"
|
5
|
-
require "dry/schema/message_compiler"
|
6
|
-
|
7
3
|
require "dry/schema/extensions/hints/compiler_methods"
|
8
4
|
require "dry/schema/extensions/hints/message_compiler_methods"
|
9
5
|
require "dry/schema/extensions/hints/message_set_methods"
|
@@ -56,6 +52,10 @@ module Dry
|
|
56
52
|
|
57
53
|
# Hints extensions
|
58
54
|
module Extensions
|
55
|
+
# @api private
|
56
|
+
module Hints
|
57
|
+
end
|
58
|
+
|
59
59
|
Compiler.prepend(Hints::CompilerMethods)
|
60
60
|
MessageCompiler.prepend(Hints::MessageCompilerMethods)
|
61
61
|
MessageSet.prepend(Hints::MessageSetMethods)
|
data/lib/dry/schema/json.rb
CHANGED
data/lib/dry/schema/key_map.rb
CHANGED
data/lib/dry/schema/message.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/initializer"
|
4
|
-
|
5
4
|
require "dry/schema/constants"
|
6
|
-
require "dry/schema/message"
|
7
|
-
require "dry/schema/message_compiler/visitor_opts"
|
8
|
-
require "dry/schema/message_set"
|
9
|
-
require "dry/schema/path"
|
10
5
|
|
11
6
|
module Dry
|
12
7
|
module Schema
|
@@ -3,9 +3,7 @@
|
|
3
3
|
require "yaml"
|
4
4
|
require "pathname"
|
5
5
|
|
6
|
-
require "dry/core/equalizer"
|
7
6
|
require "dry/schema/constants"
|
8
|
-
require "dry/schema/messages/abstract"
|
9
7
|
|
10
8
|
module Dry
|
11
9
|
module Schema
|
@@ -169,11 +167,9 @@ module Dry
|
|
169
167
|
text = input.gsub("%", "#")
|
170
168
|
|
171
169
|
# rubocop:disable Security/Eval
|
172
|
-
# rubocop:disable Style/DocumentDynamicEvalDefinition
|
173
170
|
evaluator = eval(<<~RUBY, EMPTY_CONTEXT, __FILE__, __LINE__ + 1)
|
174
171
|
-> (#{tokens.map { |token| "#{token}:" }.join(", ")}) { "#{text}" }
|
175
172
|
RUBY
|
176
|
-
# rubocop:enable Style/DocumentDynamicEvalDefinition
|
177
173
|
# rubocop:enable Security/Eval
|
178
174
|
|
179
175
|
{
|
data/lib/dry/schema/messages.rb
CHANGED
data/lib/dry/schema/params.rb
CHANGED
data/lib/dry/schema/processor.rb
CHANGED
@@ -1,15 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/configurable"
|
4
3
|
require "dry/initializer"
|
5
|
-
require "dry/logic/operators"
|
6
|
-
|
7
|
-
require "dry/schema/type_registry"
|
8
|
-
require "dry/schema/type_container"
|
9
|
-
require "dry/schema/processor_steps"
|
10
|
-
require "dry/schema/rule_applier"
|
11
|
-
require "dry/schema/key_coercer"
|
12
|
-
require "dry/schema/value_coercer"
|
13
4
|
|
14
5
|
module Dry
|
15
6
|
module Schema
|
data/lib/dry/schema/result.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dry/initializer"
|
4
|
-
|
5
4
|
require "dry/schema/constants"
|
6
|
-
require "dry/schema/config"
|
7
|
-
require "dry/schema/result"
|
8
|
-
require "dry/schema/messages"
|
9
|
-
require "dry/schema/message_compiler"
|
10
5
|
|
11
6
|
module Dry
|
12
7
|
module Schema
|
data/lib/dry/schema/step.rb
CHANGED
data/lib/dry/schema/trace.rb
CHANGED
data/lib/dry/schema/version.rb
CHANGED
data/lib/dry/schema.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "zeitwerk"
|
4
4
|
|
5
|
-
require "dry/
|
6
|
-
require "dry/
|
7
|
-
require "dry/
|
8
|
-
require "dry/
|
9
|
-
require "dry/schema/json"
|
5
|
+
require "dry/core"
|
6
|
+
require "dry/configurable"
|
7
|
+
require "dry/logic"
|
8
|
+
require "dry/types"
|
10
9
|
|
11
10
|
module Dry
|
12
11
|
# Main interface
|
@@ -15,6 +14,28 @@ module Dry
|
|
15
14
|
module Schema
|
16
15
|
extend Dry::Core::Extensions
|
17
16
|
|
17
|
+
# @api private
|
18
|
+
def self.loader
|
19
|
+
@loader ||= Zeitwerk::Loader.new.tap do |loader|
|
20
|
+
root = File.expand_path("..", __dir__)
|
21
|
+
loader.tag = "dry-schema"
|
22
|
+
loader.inflector = Zeitwerk::GemInflector.new("#{root}/dry-schema.rb")
|
23
|
+
loader.inflector.inflect(
|
24
|
+
"dsl" => "DSL",
|
25
|
+
"yaml" => "YAML",
|
26
|
+
"json" => "JSON",
|
27
|
+
"i18n" => "I18n"
|
28
|
+
)
|
29
|
+
loader.push_dir(root)
|
30
|
+
loader.ignore(
|
31
|
+
"#{root}/dry-schema.rb",
|
32
|
+
"#{root}/dry/schema/{constants,errors,version,extensions}.rb",
|
33
|
+
"#{root}/dry/schema/extensions"
|
34
|
+
)
|
35
|
+
loader.inflector.inflect("dsl" => "DSL")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
18
39
|
# Configuration
|
19
40
|
#
|
20
41
|
# @example
|
@@ -84,6 +105,8 @@ module Dry
|
|
84
105
|
def self.JSON(**options, &block)
|
85
106
|
define(**options, processor_type: JSON, &block)
|
86
107
|
end
|
108
|
+
|
109
|
+
loader.setup
|
87
110
|
end
|
88
111
|
end
|
89
112
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -30,40 +30,34 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 0.13.0
|
33
|
+
version: '0.16'
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
38
|
- - "~>"
|
42
39
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.13.0
|
40
|
+
version: '0.16'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: dry-core
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
45
|
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
47
|
+
version: '0.9'
|
54
48
|
- - ">="
|
55
49
|
- !ruby/object:Gem::Version
|
56
|
-
version: '0.
|
50
|
+
version: '0.9'
|
57
51
|
type: :runtime
|
58
52
|
prerelease: false
|
59
53
|
version_requirements: !ruby/object:Gem::Requirement
|
60
54
|
requirements:
|
61
55
|
- - "~>"
|
62
56
|
- !ruby/object:Gem::Version
|
63
|
-
version: '0.
|
57
|
+
version: '0.9'
|
64
58
|
- - ">="
|
65
59
|
- !ruby/object:Gem::Version
|
66
|
-
version: '0.
|
60
|
+
version: '0.9'
|
67
61
|
- !ruby/object:Gem::Dependency
|
68
62
|
name: dry-initializer
|
69
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,28 +78,42 @@ dependencies:
|
|
84
78
|
requirements:
|
85
79
|
- - "~>"
|
86
80
|
- !ruby/object:Gem::Version
|
87
|
-
version: '1.
|
81
|
+
version: '1.3'
|
88
82
|
type: :runtime
|
89
83
|
prerelease: false
|
90
84
|
version_requirements: !ruby/object:Gem::Requirement
|
91
85
|
requirements:
|
92
86
|
- - "~>"
|
93
87
|
- !ruby/object:Gem::Version
|
94
|
-
version: '1.
|
88
|
+
version: '1.3'
|
95
89
|
- !ruby/object:Gem::Dependency
|
96
90
|
name: dry-types
|
97
91
|
requirement: !ruby/object:Gem::Requirement
|
98
92
|
requirements:
|
99
93
|
- - "~>"
|
100
94
|
- !ruby/object:Gem::Version
|
101
|
-
version: '1.
|
95
|
+
version: '1.6'
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.6'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: zeitwerk
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '2.6'
|
102
110
|
type: :runtime
|
103
111
|
prerelease: false
|
104
112
|
version_requirements: !ruby/object:Gem::Requirement
|
105
113
|
requirements:
|
106
114
|
- - "~>"
|
107
115
|
- !ruby/object:Gem::Version
|
108
|
-
version: '
|
116
|
+
version: '2.6'
|
109
117
|
- !ruby/object:Gem::Dependency
|
110
118
|
name: bundler
|
111
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,7 +195,6 @@ files:
|
|
187
195
|
- lib/dry/schema/key_coercer.rb
|
188
196
|
- lib/dry/schema/key_map.rb
|
189
197
|
- lib/dry/schema/key_validator.rb
|
190
|
-
- lib/dry/schema/macros.rb
|
191
198
|
- lib/dry/schema/macros/array.rb
|
192
199
|
- lib/dry/schema/macros/core.rb
|
193
200
|
- lib/dry/schema/macros/dsl.rb
|
data/lib/dry/schema/macros.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "dry/schema/macros/array"
|
4
|
-
require "dry/schema/macros/each"
|
5
|
-
require "dry/schema/macros/filled"
|
6
|
-
require "dry/schema/macros/schema"
|
7
|
-
require "dry/schema/macros/hash"
|
8
|
-
require "dry/schema/macros/maybe"
|
9
|
-
require "dry/schema/macros/optional"
|
10
|
-
require "dry/schema/macros/required"
|