hanami-validations 2.0.0.alpha1 → 2.0.0.beta4

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: c94b88f4b0a39d33e6ce6d5a27e9c843afc611b3a5d76ac48799c05648c73ed1
4
- data.tar.gz: 93a768f5a5c977ada49f6f400bade010ebe87be3072ab7b1fdec6e36afe0f00a
3
+ metadata.gz: 11ebd88a5710aa7a47ed701a5d7d58d160a46fb7fcb62409d32f716cbd2fdaac
4
+ data.tar.gz: 37854ca931fe8744a63c73d663547ea38b78ba538c2c0aeffbc905f95c015b30
5
5
  SHA512:
6
- metadata.gz: 01bae680528b53b9564393aaa923f6e66f91d9ccda370e6297c6c458b0fbc127c83a39a1ba61d110bb7c698e28cb95e8ce8bb0f7f174bc151a384bb7b3bdb3d5
7
- data.tar.gz: 15c2f866bae8f77acca611e4a70aefc6da227fc33aa556e14beff08e2725880e094a6de7fa9a5cbcff22fa8fce80f282f4623627cb206119821ebdab41e5fc6a
6
+ metadata.gz: 043edfe73d37670bc9193c83255f68e91e020f16da6b496f24ef9bf1478abdccde0c9f5397bf7ed82b57e8acaa2bd540de5232a5676cf46c3715804c8ce29d4e
7
+ data.tar.gz: f149d5806461229faf338d2dbbe7f9fdd4a25aee8f18ce3e3e309df727940ff78307324ad1d0b392f80a33c9c5c41e70c442fa3eb9ba7779f393cb58ba78d3a9
data/CHANGELOG.md CHANGED
@@ -1,8 +1,33 @@
1
1
  # Hanami::Validations
2
+
2
3
  Validations mixin for Ruby objects
3
4
 
5
+ ## v2.0.0.beta4 - 2022-10-24
6
+
7
+ ### Changed
8
+
9
+ - [Tim Riley] Require latest dry-validation (to ensure best compatibility with Zeitwerk-enabled dry-rb gems) (#224)
10
+
11
+ ## v2.0.0.beta1 - 2022-07-20
12
+
13
+ ### Added
14
+
15
+ - [Luca Guidi] Official support for Ruby: MRI 3.1
16
+
17
+ ## v2.0.0.alpha2 - 2021-05-04
18
+
19
+ ### Added
20
+
21
+ - [Luca Guidi] Official support for Ruby: MRI 3.0
22
+
23
+ ### Changed
24
+
25
+ - [Luca Guidi] Drop support for Ruby: MRI 2.4, 2.5
26
+
4
27
  ## v2.0.0.alpha1 - 2019-07-26
28
+
5
29
  ### Added
30
+
6
31
  - [Luca Guidi] Introduced `Hanami::Validator`
7
32
  - [Luca Guidi] Added support to validate JSON data
8
33
  - [Luca Guidi] Added rules
@@ -11,6 +36,7 @@ Validations mixin for Ruby objects
11
36
  - [Luca Guidi] Added support for validator external dependencies
12
37
 
13
38
  ### Changed
39
+
14
40
  - [Luca Guidi] Drop support for Ruby: MRI 2.3, JRuby 9.1.
15
41
  - [Luca Guidi] New validation syntax
16
42
  - [Luca Guidi] Removed custom predicates (`Hanami::Validations.predicate`)
@@ -19,36 +45,68 @@ Validations mixin for Ruby objects
19
45
  - [Luca Guidi] Removed messages namespace setting (`Hanami::Validations.namespace`)
20
46
  - [Luca Guidi] Removed messages engine setting (`Hanami::Validations.messages`)
21
47
 
48
+ ## v1.3.7 - 2021-01-06
49
+
50
+ ### Fixed
51
+
52
+ - [Panagiotis Matsinopoulos] Ensure `predicate` and `predicates` to work together
53
+
54
+ ## v1.3.6 - 2020-01-08
55
+
56
+ ### Added
57
+
58
+ - [Luca Guidi] Official support for Ruby: MRI 2.7
59
+
60
+ ## v1.3.5 - 2019-07-26
61
+
62
+ ### Fixed
63
+
64
+ - [ippachi] Ensure I18n doesn't crash when used for inline predicates
65
+
22
66
  ## v1.3.4 - 2019-07-26
67
+
23
68
  ### Fixed
69
+
24
70
  - [Luca Guidi] Ensure to load i18n backend (including `i18n` gem), when messages engine is `:i18n`
25
71
 
26
72
  ## v1.3.3 - 2019-01-31
73
+
27
74
  ### Fixed
75
+
28
76
  - [Luca Guidi] Depend on `dry-validation` `~> 0.11`, `< 0.12`
29
77
  - [Luca Guidi] Depend on `dry-logic` `~> 0.4.2`, `< 0.5`
30
78
 
31
79
  ## v1.3.2 - 2019-01-30
80
+
32
81
  ### Fixed
82
+
33
83
  - [Luca Guidi] Depend on `dry-validation` `~> 0.11.2`, `< 0.12` in order to skip non compatible `dry-logic` `0.5.0`
34
84
 
35
85
  ## v1.3.1 - 2019-01-18
86
+
36
87
  ### Added
88
+
37
89
  - [Luca Guidi] Official support for Ruby: MRI 2.6
38
90
  - [Luca Guidi] Support `bundler` 2.0+
39
91
 
40
92
  ## v1.3.0 - 2018-10-24
41
93
 
42
94
  ## v1.3.0.beta1 - 2018-08-08
95
+
43
96
  ### Added
97
+
44
98
  - [Luca Guidi] Official support for JRuby 9.2.0.0
45
99
 
46
100
  ## v1.2.2 - 2018-06-05
101
+
47
102
  ### Fixed
103
+
48
104
  - [Luca Guidi] Revert dependency to `dry-validation` to `~> 0.11`, `< 0.12`
49
105
 
50
106
  ## v1.2.1 - 2018-06-04
107
+
51
108
  ### Fixed
109
+
52
110
  - [Luca Guidi] Bump dependency to `dry-validation` to `~> 0.12`
53
111
 
54
112
  ## v1.2.0 - 2018-04-11
@@ -60,7 +118,9 @@ Validations mixin for Ruby objects
60
118
  ## v1.2.0.beta2 - 2018-03-23
61
119
 
62
120
  ## v1.2.0.beta1 - 2018-02-28
121
+
63
122
  ### Added
123
+
64
124
  - [Luca Guidi] Official support for Ruby: MRI 2.5
65
125
 
66
126
  ## v1.1.0 - 2017-10-25
@@ -80,22 +140,31 @@ Validations mixin for Ruby objects
80
140
  ## v1.0.0.beta2 - 2017-03-17
81
141
 
82
142
  ## v1.0.0.beta1 - 2017-02-14
143
+
83
144
  ### Added
145
+
84
146
  - [Luca Guidi] Official support for Ruby: MRI 2.4
85
147
 
86
148
  ### Fixed
149
+
87
150
  - [Luca Guidi] Don't let inline predicates to discard other YAML error messages
88
151
 
89
152
  ## v0.7.1 - 2016-11-18
153
+
90
154
  ### Fixed
155
+
91
156
  - [Luca Guidi] Ensure custom validators to work with concrete classes with name
92
157
 
93
158
  ## v0.7.0 - 2016-11-15
159
+
94
160
  ### Changed
161
+
95
162
  - [Luca Guidi] Official support for Ruby: MRI 2.3+ and JRuby 9.1.5.0+
96
163
 
97
164
  ## v0.6.0 - 2016-07-22
165
+
98
166
  ### Added
167
+
99
168
  - [Luca Guidi] Predicates syntax
100
169
  - [Luca Guidi] Custom predicates
101
170
  - [Luca Guidi] Inline predicates
@@ -106,10 +175,13 @@ Validations mixin for Ruby objects
106
175
  - [Luca Guidi] Introduced `Hanami::Validations::Form` mixin, which must be used when input comes from HTTP params or web forms.
107
176
 
108
177
  ### Fixed
178
+
109
179
  – [Luca Guidi] Ensure to threat blank values as `nil`
110
180
 
111
181
  ### Changed
182
+
112
183
  – [Luca Guidi] Drop support for Ruby 2.0, 2.1 and Rubinius. Official support for JRuby 9.0.5.0+.
184
+
113
185
  - [Luca Guidi] Validations must be wrapped in `.validations` block.
114
186
  - [Luca Guidi] Removed `.attribute` DSL. A validator doesn't create accessors (getters/setters) for validated keys.
115
187
  - [Luca Guidi] Removed `Hanami::Validations#valid?` in favor of `#validate`.
@@ -117,62 +189,86 @@ Validations mixin for Ruby objects
117
189
  - [Luca Guidi] Coerced and sanitized data is accessible via result object. Eg. `result.output`
118
190
 
119
191
  ## v0.5.0 - 2016-01-22
192
+
120
193
  ### Changed
194
+
121
195
  - [Luca Guidi] Renamed the project
122
196
 
123
197
  ## v0.4.0 - 2016-01-12
198
+
124
199
  ## Changed
200
+
125
201
  - [Hélio Costa e Silva & Luca Guidi] Ignore blank values for format and size validation
126
202
 
127
203
  ### Fixed
204
+
128
205
  - [Pascal Betz] Ensure acceptance validation to reject blank strings
129
206
 
130
207
  ## v0.3.3 - 2015-09-30
208
+
131
209
  ### Added
210
+
132
211
  - [Luca Guidi] Official support for JRuby 9k+
133
212
 
134
213
  ## v0.3.2 - 2015-05-22
214
+
135
215
  ### Added
216
+
136
217
  - [deepj] Introduced `Lotus::Validations#invalid?`
137
218
 
138
219
  ## v0.3.1 - 2015-05-15
220
+
139
221
  ### Fixed
222
+
140
223
  - [Luca Guidi] Fixed Hash serialization for nested validations. It always return nested `::Hash` structure.
141
224
  - [Alfonso Uceda Pompa & Dmitry Tymchuk] Fixed Hash serialization when `Lotus::Entity` is included in the same class.
142
225
 
143
226
  ## v0.3.0 - 2015-03-23
144
227
 
145
228
  ## v0.2.4 - 2015-01-30
229
+
146
230
  ### Added
231
+
147
232
  - [Steve Hodgkiss] Introduced `Lotus::Validations::Error#attribute_name`
148
233
  - [Steve Hodgkiss] Nested validations
149
234
 
150
235
  ### Changed
236
+
151
237
  - [Steve Hodgkiss] `Lotus::Validations::Error#name` returns the complete attribute name (Eg. `first_name` or `address.street`)
152
238
 
153
239
  ## v0.2.3 - 2015-01-12
240
+
154
241
  ### Added
242
+
155
243
  - [Luca Guidi] Compatibility with Lotus::Entity
156
244
 
157
245
  ### Fixed
246
+
158
247
  - [Luca Guidi] Ensure `.validates` usage to not raise `ArgumentError` when `:type` option is passed
159
248
  - [Luca Guidi] Ensure to assign attributes when only `.validates` is used
160
249
 
161
250
  ## v0.2.2 - 2015-01-08
251
+
162
252
  ### Added
253
+
163
254
  - [Steve Hodgkiss] Introduced `Validations.validates`. It defines validations, for already existing attributes.
164
255
 
165
256
  ## v0.2.1 - 2014-12-23
257
+
166
258
  ### Added
259
+
167
260
  - [Luca Guidi] Introduced `Validations::Errors#to_h` and `to_a`
168
261
  - [Luca Guidi] Introduced `Validations::Errors#any?`
169
262
  - [Luca Guidi] Official support for Ruby 2.2
170
263
 
171
264
  ### Fixed
265
+
172
266
  - [Satoshi Amemiya] Made `Validations#valid?` idempotent
173
267
 
174
268
  ## v0.2.0 - 2014-11-23
269
+
175
270
  ### Added
271
+
176
272
  - [Luca Guidi] Skip attribute whitelisting when a validator does not define any attribute
177
273
  - [Luca Guidi] Official support for Rubinius 2.3+
178
274
  - [Luca Guidi] Implemented `#each` in order to allow bulk operations on attributes
@@ -182,7 +278,9 @@ Validations mixin for Ruby objects
182
278
  - [Rik Tonnard] Made validators reusable by allowing infinite inclusion
183
279
 
184
280
  ## v0.1.0 - 2014-10-23
281
+
185
282
  ### Added
283
+
186
284
  - [Luca Guidi] Made `#initialize` to accept any object that implements `#to_h`
187
285
  - [Luca Guidi] Custom coercions for user defined classes
188
286
  - [Luca Guidi] Raise an exception at the load time when a validation is not recognized
@@ -200,5 +298,6 @@ Validations mixin for Ruby objects
200
298
  - [Luca Guidi] Official support for MRI 2.0+
201
299
 
202
300
  ### Fixed
301
+
203
302
  - [Jeremy Stephens] Ensure to not fail validations when coerce falsey values
204
303
  - [Luca Guidi] Ensure `Lotus::Validations#valid?` to be idempotent
data/README.md CHANGED
@@ -5,13 +5,15 @@ Data validation library for Ruby
5
5
  ## Status
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/hanami-validations.svg)](https://badge.fury.io/rb/hanami-validations)
8
- [![TravisCI](https://travis-ci.org/hanami/validations.svg?branch=master)](https://travis-ci.org/hanami/validations)
9
- [![CircleCI](https://circleci.com/gh/hanami/validations/tree/master.svg?style=svg)](https://circleci.com/gh/hanami/validations/tree/master)
10
- [![Build Status](https://ci.hanamirb.org/api/badges/hanami/validations/status.svg)](https://ci.hanamirb.org/hanami/validations)
11
- [![Test Coverage](https://codecov.io/gh/hanami/validations/branch/master/graph/badge.svg)](https://codecov.io/gh/hanami/validations)
8
+ [![CI](https://github.com/hanami/validations/workflows/ci/badge.svg?branch=main)](https://github.com/hanami/validations/actions?query=workflow%3Aci+branch%3Amain)
9
+ [![Test Coverage](https://codecov.io/gh/hanami/validations/branch/main/graph/badge.svg)](https://codecov.io/gh/hanami/validations)
12
10
  [![Depfu](https://badges.depfu.com/badges/af6c6be539d9d587c7541ae7a013c9ff/overview.svg)](https://depfu.com/github/hanami/validations?project=Bundler)
13
11
  [![Inline Docs](http://inch-ci.org/github/hanami/validations.svg)](http://inch-ci.org/github/hanami/validations)
14
12
 
13
+ ## Version
14
+
15
+ **This branch contains the code for `hanami-validations` 2.x.**
16
+
15
17
  ## Contact
16
18
 
17
19
  * Home page: http://hanamirb.org
@@ -25,7 +27,7 @@ Data validation library for Ruby
25
27
 
26
28
  ## Rubies
27
29
 
28
- __Hanami::Validations__ supports Ruby (MRI) 2.4+ and JRuby 9.2+
30
+ __Hanami::Validations__ supports Ruby (MRI) 3.0+
29
31
 
30
32
  ## Installation
31
33
 
@@ -50,7 +52,7 @@ $ gem install hanami-validations
50
52
  ## Usage
51
53
 
52
54
  [Hanami](http://hanamirb.org), [ROM](https://rom-rb.org), and [DRY](https://dry-rb.org) projects are working together to create a strong Ruby ecosystem.
53
- `hanami-validations` is based on [`dry-validation`](https://dry-rb.org/gems/dry-validation), for this reason the documentation explains the basics of this gem, but for advanced topics, it links to `dry-validation` docs.
55
+ `hanami-validations` is based on [`dry-validation`](https://dry-rb.org/gems/dry-validation/master/), for this reason the documentation explains the basics of this gem, but for advanced topics, it links to `dry-validation` docs.
54
56
 
55
57
  ### Overview
56
58
 
@@ -255,7 +257,7 @@ puts result.success? # => true
255
257
  puts result.to_h # => {:start_date=>#<Date: 2019-07-03 ((2458668j,0s,0n),+0s,2299161j)>}
256
258
  ```
257
259
 
258
- Learn more about rules: https://dry-rb.org/gems/dry-validation/rules/
260
+ Learn more about rules: https://dry-rb.org/gems/dry-validation/master/rules/
259
261
 
260
262
  ### Inheritance
261
263
 
@@ -401,7 +403,7 @@ puts result.success? # => false
401
403
  puts result.errors.to_h # => {:refunded_code=>["there is a network error (123)"]}
402
404
  ```
403
405
 
404
- Learn more about messages: https://dry-rb.org/gems/dry-validation/messages/
406
+ Learn more about messages: https://dry-rb.org/gems/dry-validation/master/messages/
405
407
 
406
408
  ### External dependencies
407
409
 
@@ -438,7 +440,7 @@ puts result.success? # => false
438
440
  puts result.errors.to_h # => {:address=>["not a valid address"]}
439
441
  ```
440
442
 
441
- Read more about external dependencies: https://dry-rb.org/gems/dry-validation/external-dependencies/
443
+ Read more about external dependencies: https://dry-rb.org/gems/dry-validation/master/external-dependencies/
442
444
 
443
445
  ### Mixin
444
446
 
@@ -491,6 +493,6 @@ If you need to implement it, please use the External dependencies feature (see a
491
493
 
492
494
  ## Copyright
493
495
 
494
- Copyright © 2014-2019 Luca Guidi – Released under MIT License
496
+ Copyright © 2014-2021 Luca Guidi – Released under MIT License
495
497
 
496
498
  This project was formerly known as Lotus (`lotus-validations`).
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path("lib", __dir__)
3
+ lib = File.expand_path("../lib", __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "hanami/validations/version"
6
6
 
@@ -14,15 +14,16 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "http://hanamirb.org"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -- lib/* LICENSE.md README.md CHANGELOG.md hanami-validations.gemspec`.split($INPUT_RECORD_SEPARATOR)
17
+ spec.files = `git ls-files -- lib/* LICENSE.md README.md CHANGELOG.md hanami-validations.gemspec`.split($/)
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
19
  spec.require_paths = ["lib"]
21
- spec.required_ruby_version = ">= 2.4.0"
20
+ spec.metadata["rubygems_mfa_required"] = "true"
21
+ spec.required_ruby_version = ">= 3.0"
22
22
 
23
- spec.add_dependency "dry-validation", "~> 1.0"
23
+ spec.add_dependency "dry-validation", "~> 1.9", ">= 1.9.0"
24
24
 
25
25
  spec.add_development_dependency "bundler", ">= 1.6", "< 3"
26
- spec.add_development_dependency "rake", "~> 12"
27
- spec.add_development_dependency "rspec", "~> 3.7"
26
+ spec.add_development_dependency "rake", "~> 13"
27
+ spec.add_development_dependency "rspec", "~> 3.9"
28
+ spec.add_development_dependency "rubocop", "~> 1.0"
28
29
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Hanami
4
4
  module Validations
5
- VERSION = "2.0.0.alpha1"
5
+ # @since 0.1.0
6
+ VERSION = "2.0.0.beta4"
6
7
  end
7
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha1
4
+ version: 2.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2022-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.9'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.9.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '1.0'
29
+ version: '1.9'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.9.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,28 +56,42 @@ dependencies:
50
56
  requirements:
51
57
  - - "~>"
52
58
  - !ruby/object:Gem::Version
53
- version: '12'
59
+ version: '13'
54
60
  type: :development
55
61
  prerelease: false
56
62
  version_requirements: !ruby/object:Gem::Requirement
57
63
  requirements:
58
64
  - - "~>"
59
65
  - !ruby/object:Gem::Version
60
- version: '12'
66
+ version: '13'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: rspec
63
69
  requirement: !ruby/object:Gem::Requirement
64
70
  requirements:
65
71
  - - "~>"
66
72
  - !ruby/object:Gem::Version
67
- version: '3.7'
73
+ version: '3.9'
68
74
  type: :development
69
75
  prerelease: false
70
76
  version_requirements: !ruby/object:Gem::Requirement
71
77
  requirements:
72
78
  - - "~>"
73
79
  - !ruby/object:Gem::Version
74
- version: '3.7'
80
+ version: '3.9'
81
+ - !ruby/object:Gem::Dependency
82
+ name: rubocop
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '1.0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '1.0'
75
95
  description: Validations mixin for Ruby objects and support for Hanami
76
96
  email:
77
97
  - me@lucaguidi.com
@@ -90,8 +110,9 @@ files:
90
110
  homepage: http://hanamirb.org
91
111
  licenses:
92
112
  - MIT
93
- metadata: {}
94
- post_install_message:
113
+ metadata:
114
+ rubygems_mfa_required: 'true'
115
+ post_install_message:
95
116
  rdoc_options: []
96
117
  require_paths:
97
118
  - lib
@@ -99,15 +120,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
120
  requirements:
100
121
  - - ">="
101
122
  - !ruby/object:Gem::Version
102
- version: 2.4.0
123
+ version: '3.0'
103
124
  required_rubygems_version: !ruby/object:Gem::Requirement
104
125
  requirements:
105
126
  - - ">"
106
127
  - !ruby/object:Gem::Version
107
128
  version: 1.3.1
108
129
  requirements: []
109
- rubygems_version: 3.0.3
110
- signing_key:
130
+ rubygems_version: 3.3.7
131
+ signing_key:
111
132
  specification_version: 4
112
133
  summary: Validations mixin for Ruby objects
113
134
  test_files: []