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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cbb33c9bad218b481c727b04080736ad0d974f47b552ed305de4f50e5bd8d6d
4
- data.tar.gz: e464d56a10afa52ab975d44d204a0879649007eeb98a1a15038e5c6d29b78b21
3
+ metadata.gz: fb13f4dba2e8837c0cff3c3d092eacc87c29c367286f6e16f37c4b5d78179066
4
+ data.tar.gz: 66196d258e68914b4546dcc20033e74627f2c738fcbeadbe6d4bfff746861cc0
5
5
  SHA512:
6
- metadata.gz: 94637a8714ffc4111c0279a7aeb52613fccf894abd33207600131e7af59803371b044691949c9a457c85bbdbb9d063c7c050aa58fc51966e7469b62f97156008
7
- data.tar.gz: f15fbb334bd99fe79348a750bca344beff68156394c314f1845307a1b5b2462446117a80e47d0d3eb40108e3042de99744c205a7ffc99ef48bebd179a5fa0299
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
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2021 dry-rb team
3
+ Copyright (c) 2015-2022 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
@@ -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.5", ">= 0.5"
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.8", ">= 1.8.0"
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,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/schema/config"
4
- require "dry/validation/macros"
5
-
6
3
  module Dry
7
4
  module Validation
8
5
  # Configuration for contracts
@@ -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/rule"
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
- .any? { |key|
144
- curr_path = Schema::Path[path.keys[0..path.keys.index(key)]]
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
 
@@ -1,10 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/initializer"
4
- require "dry/core/deprecations"
5
-
6
4
  require "dry/validation/constants"
7
- require "dry/validation/failures"
8
5
 
9
6
  module Dry
10
7
  module Validation
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/schema/predicate_registry"
4
- require "dry/validation/contract"
5
-
6
3
  module Dry
7
4
  module Validation
8
5
  # Predicate registry with additional needed methods.
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/validation/constants"
4
- require "dry/validation/function"
5
4
 
6
5
  module Dry
7
6
  module Validation
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/container"
4
- require "dry/validation/macro"
5
4
 
6
5
  module Dry
7
6
  module Validation
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/core/equalizer"
4
-
5
- require "dry/schema/constants"
6
- require "dry/schema/message"
7
-
8
3
  module Dry
9
4
  module Validation
10
5
  # Message message
@@ -1,9 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/schema/message_set"
4
-
5
3
  require "dry/validation/constants"
6
- require "dry/validation/message"
7
4
 
8
5
  module Dry
9
6
  module Validation
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/validation/message"
4
- require "dry/schema/message_compiler"
5
-
6
3
  module Dry
7
4
  module Validation
8
5
  module Messages
@@ -1,11 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "concurrent/map"
4
- require "dry/core/equalizer"
5
4
 
6
5
  require "dry/validation/constants"
7
- require "dry/validation/message_set"
8
- require "dry/validation/values"
9
6
 
10
7
  module Dry
11
8
  module Validation
@@ -1,9 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/core/equalizer"
4
-
5
3
  require "dry/validation/constants"
6
- require "dry/validation/function"
7
4
 
8
5
  module Dry
9
6
  module Validation
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/core/equalizer"
4
3
  require "dry/schema/path"
5
4
  require "dry/validation/constants"
6
5
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Validation
5
- VERSION = "1.8.1"
5
+ VERSION = "1.9.0"
6
6
  end
7
7
  end
@@ -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
- extend Macros::Registrar
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.8.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-05-28 00:00:00.000000000 Z
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.5'
53
+ version: '0.9'
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: '0.5'
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.5'
63
+ version: '0.9'
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: '0.5'
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.8'
87
+ version: '1.11'
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 1.8.0
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.8'
97
+ version: '1.11'
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
- version: 1.8.0
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.2.32
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: []