dry-validation 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +153 -113
- data/dry-validation.gemspec +39 -0
- data/lib/dry/validation/rule.rb +7 -1
- data/lib/dry/validation/version.rb +1 -1
- metadata +28 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea571eab29d2c8f50457cd8472a8f0d66da98bfda7f7fd1b697776532193b12d
|
4
|
+
data.tar.gz: 0e45ff77064b269b25e4c9dbc84219dcc78e07390bb14e75dd2fa0ab24593096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddc760c72d530ceada83071591ebb7d214ed1c1fe7ec56486120170cd8b32a50916468dc086018820d3505a1eb14df1cbfe07a80b212da7c5f67c262dc47847b
|
7
|
+
data.tar.gz: d06df105ce8e8a9ef8720dd6df9748585c9621a39bca8a73067e337ad153edbdbd052581be687a6df9bc0c62e16b1ad9fb8866014a0d4ba9a2c411c31d892610
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
-
|
1
|
+
## 1.4.2 2020-01-18
|
2
|
+
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
- Macros using predicates that accept a range argument work as expected (no need to wrap the argument in an array) (@waiting-for-dev)
|
7
|
+
|
8
|
+
|
9
|
+
[Compare v1.4.1...v1.4.2](https://github.com/dry-rb/dry-validation/compare/v1.4.1...v1.4.2)
|
10
|
+
|
11
|
+
## 1.4.1 2020-01-08
|
12
|
+
|
2
13
|
|
3
14
|
### Added
|
4
15
|
|
@@ -8,11 +19,12 @@
|
|
8
19
|
|
9
20
|
- List tokens are correctly interpolated as a comma separated list in rule messages (see #611) (@waiting-for-dev)
|
10
21
|
- Warnings about delegated keywords (@flash-gordon)
|
11
|
-
|
22
|
+
|
12
23
|
|
13
24
|
[Compare v1.4.0...v1.4.1](https://github.com/dry-rb/dry-validation/compare/v1.4.0...v1.4.1)
|
14
25
|
|
15
|
-
|
26
|
+
## 1.4.0 2019-12-12
|
27
|
+
|
16
28
|
|
17
29
|
### Added
|
18
30
|
|
@@ -32,7 +44,8 @@
|
|
32
44
|
|
33
45
|
[Compare v1.3.1...v1.4.0](https://github.com/dry-rb/dry-validation/compare/v1.3.1...v1.4.0)
|
34
46
|
|
35
|
-
|
47
|
+
## 1.3.1 2019-08-16
|
48
|
+
|
36
49
|
|
37
50
|
### Changed
|
38
51
|
|
@@ -40,7 +53,8 @@
|
|
40
53
|
|
41
54
|
[Compare v1.3.0...v1.3.1](https://github.com/dry-rb/dry-validation/compare/v1.3.0...v1.3.1)
|
42
55
|
|
43
|
-
|
56
|
+
## 1.3.0 2019-08-14
|
57
|
+
|
44
58
|
|
45
59
|
### Added
|
46
60
|
|
@@ -56,7 +70,8 @@
|
|
56
70
|
|
57
71
|
[Compare v1.2.1...v1.3.0](https://github.com/dry-rb/dry-validation/compare/v1.2.1...v1.3.0)
|
58
72
|
|
59
|
-
|
73
|
+
## 1.2.1 2019-07-16
|
74
|
+
|
60
75
|
|
61
76
|
### Fixed
|
62
77
|
|
@@ -65,9 +80,11 @@
|
|
65
80
|
- Fixed an issue where guarding a rule would crash when keys are missing in the input (issue #569) (@solnic)
|
66
81
|
- Added missing "pathname" require (issue #570) (@solnic)
|
67
82
|
|
83
|
+
|
68
84
|
[Compare v1.2.0...v1.2.1](https://github.com/dry-rb/dry-validation/compare/v1.2.0...v1.2.1)
|
69
85
|
|
70
|
-
|
86
|
+
## 1.2.0 2019-07-08
|
87
|
+
|
71
88
|
|
72
89
|
### Added
|
73
90
|
|
@@ -83,15 +100,18 @@
|
|
83
100
|
|
84
101
|
[Compare v1.1.1...v1.2.0](https://github.com/dry-rb/dry-validation/compare/v1.1.1...v1.2.0)
|
85
102
|
|
86
|
-
|
103
|
+
## 1.1.1 2019-06-24
|
104
|
+
|
87
105
|
|
88
106
|
### Fixed
|
89
107
|
|
90
108
|
- `Rule#each` works with array values from nested hashes (@mustardnoise)
|
91
109
|
|
110
|
+
|
92
111
|
[Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-validation/compare/v1.1.0...v1.1.1)
|
93
112
|
|
94
|
-
|
113
|
+
## 1.1.0 2019-06-14
|
114
|
+
|
95
115
|
|
96
116
|
### Added
|
97
117
|
|
@@ -103,25 +123,18 @@
|
|
103
123
|
|
104
124
|
- Passing multiple macro names to `validate` or `each` works correctly (fixed #538 #541) (@jandudulski)
|
105
125
|
|
106
|
-
[Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.1.0)
|
107
126
|
|
108
|
-
|
127
|
+
[Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.1.0)
|
109
128
|
|
110
|
-
|
129
|
+
## 1.0.0 2019-06-10
|
111
130
|
|
112
131
|
See [the list of all addressed issues](https://github.com/dry-rb/dry-validation/issues?utf8=✓&q=is%3Aissue+is%3Aclosed+closed%3A%3E%3D2019-01-01+) as well as issues that were moved to dry-schema and [addressed there](https://github.com/dry-rb/dry-schema/issues?q=is%3Aissue+is%3Aclosed+dry-validation+milestone%3A1.0.0).
|
113
132
|
|
114
|
-
### :sparkles: Release highlights :sparkles:
|
115
133
|
|
116
|
-
-
|
117
|
-
- Improved message backends with support for `key` and `base` messages, and arbitrary meta-data (like error codes etc.)
|
118
|
-
- Support for defining rules for array elements ie `rule(:items).each { ... }`
|
119
|
-
- Support for macros that encapsulate common rule logic
|
120
|
-
- Built-in `:acceptance` macro
|
134
|
+
[Compare v1.0.0...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.0.0)
|
121
135
|
|
122
|
-
|
136
|
+
## 1.0.0 2019-06-10
|
123
137
|
|
124
|
-
# v1.0.0 2019-06-10 (compared to 1.0.0.rc3)
|
125
138
|
|
126
139
|
### Added
|
127
140
|
|
@@ -144,7 +157,8 @@ See [the list of all addressed issues](https://github.com/dry-rb/dry-validation/
|
|
144
157
|
|
145
158
|
[Compare v1.0.0.rc3...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc3...v1.0.0)
|
146
159
|
|
147
|
-
|
160
|
+
## 1.0.0.rc3 2019-05-06
|
161
|
+
|
148
162
|
|
149
163
|
### Added
|
150
164
|
|
@@ -157,9 +171,10 @@ See [the list of all addressed issues](https://github.com/dry-rb/dry-validation/
|
|
157
171
|
|
158
172
|
- `config/errors.yml` are now bundled with the gem, **`rc2` was broken because of this** (solnic)
|
159
173
|
|
174
|
+
|
160
175
|
[Compare v1.0.0.rc2...v1.0.0.rc3](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc2...v1.0.0.rc3)
|
161
176
|
|
162
|
-
|
177
|
+
## 1.0.0.rc2 2019-05-04
|
163
178
|
|
164
179
|
This was **yanked** on rubygems.org because the bundled gem was missing `config` directory, thus it was not possible to require it. It was fixed in `rc3`.
|
165
180
|
|
@@ -179,7 +194,8 @@ This was **yanked** on rubygems.org because the bundled gem was missing `config`
|
|
179
194
|
|
180
195
|
[Compare v1.0.0.rc1...v1.0.0.rc2](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc1...v1.0.0.rc2)
|
181
196
|
|
182
|
-
|
197
|
+
## 1.0.0.rc1 2019-04-26
|
198
|
+
|
183
199
|
|
184
200
|
### Added
|
185
201
|
|
@@ -198,7 +214,8 @@ This was **yanked** on rubygems.org because the bundled gem was missing `config`
|
|
198
214
|
|
199
215
|
[Compare v1.0.0.beta2...v1.0.0.rc1](https://github.com/dry-rb/dry-validation/compare/v1.0.0.beta2...v1.0.0.rc1)
|
200
216
|
|
201
|
-
|
217
|
+
## 1.0.0.beta2 2019-04-04
|
218
|
+
|
202
219
|
|
203
220
|
### Added
|
204
221
|
|
@@ -226,7 +243,8 @@ This was **yanked** on rubygems.org because the bundled gem was missing `config`
|
|
226
243
|
|
227
244
|
[Compare v1.0.0.beta1...v1.0.0.beta2](https://github.com/dry-rb/dry-validation/compare/v1.0.0.beta1...v1.0.0.beta2)
|
228
245
|
|
229
|
-
|
246
|
+
## 1.0.0.beta1 2019-03-26
|
247
|
+
|
230
248
|
|
231
249
|
### Added
|
232
250
|
|
@@ -247,7 +265,7 @@ This was **yanked** on rubygems.org because the bundled gem was missing `config`
|
|
247
265
|
|
248
266
|
[Compare v1.0.0.alpha2...v1.0.0.beta1](https://github.com/dry-rb/dry-validation/compare/v1.0.0.alpha2...v1.0.0.beta1)
|
249
267
|
|
250
|
-
|
268
|
+
## 1.0.0.alpha2 2019-03-05
|
251
269
|
|
252
270
|
First round of bug fixes. Thanks for testing <3!
|
253
271
|
|
@@ -263,7 +281,7 @@ First round of bug fixes. Thanks for testing <3!
|
|
263
281
|
|
264
282
|
[Compare v1.0.0.alpha1...v1.0.0.alpha2](https://github.com/dry-rb/dry-validation/compare/v1.0.0.alpha1...v1.0.0.alpha2)
|
265
283
|
|
266
|
-
|
284
|
+
## 1.0.0.alpha1 2019-03-04
|
267
285
|
|
268
286
|
Complete rewrite on top of `dry-schema`.
|
269
287
|
|
@@ -272,22 +290,25 @@ Complete rewrite on top of `dry-schema`.
|
|
272
290
|
- [BREAKING] `Dry::Validation::Contract` as a replacement for validation schemas (solnic)
|
273
291
|
- [BREAKING] New `rule` DSL with an improved API for setting error messages (solnic)
|
274
292
|
|
293
|
+
|
275
294
|
[Compare v0.13.0...v1.0.0.alpha1](https://github.com/dry-rb/dry-validation/compare/v0.13.0...v1.0.0.alpha1)
|
276
295
|
|
277
|
-
|
296
|
+
## 0.13.0 2019-01-29
|
278
297
|
|
279
|
-
### Changed
|
280
|
-
|
281
|
-
- `dry-logic` was bumped to `~> 0.5` (solnic)
|
282
|
-
- `dry-types` was bumped to `~> 0.14` (solnic)
|
283
298
|
|
284
299
|
### Fixed
|
285
300
|
|
286
301
|
- Warning about method redefined (amatsuda)
|
287
302
|
|
303
|
+
### Changed
|
304
|
+
|
305
|
+
- `dry-logic` was bumped to `~> 0.5` (solnic)
|
306
|
+
- `dry-types` was bumped to `~> 0.14` (solnic)
|
307
|
+
|
288
308
|
[Compare v0.12.3...v0.13.0](https://github.com/dry-rb/dry-validation/compare/v0.12.3...v0.13.0)
|
289
309
|
|
290
|
-
|
310
|
+
## 0.12.3 2019-01-29
|
311
|
+
|
291
312
|
|
292
313
|
### Changed
|
293
314
|
|
@@ -295,23 +316,28 @@ Complete rewrite on top of `dry-schema`.
|
|
295
316
|
|
296
317
|
[Compare v0.12.2...v0.12.3](https://github.com/dry-rb/dry-validation/compare/v0.12.2...v0.12.3)
|
297
318
|
|
298
|
-
|
319
|
+
## 0.12.2 2018-08-29
|
320
|
+
|
299
321
|
|
300
322
|
### Fixed
|
301
323
|
|
302
324
|
- Use correct key names for rule messages when using i18n (jozzi05)
|
303
325
|
|
326
|
+
|
304
327
|
[Compare v0.12.1...v0.12.2](https://github.com/dry-rb/dry-validation/compare/v0.12.1...v0.12.2)
|
305
328
|
|
306
|
-
|
329
|
+
## 0.12.1 2018-07-06
|
330
|
+
|
307
331
|
|
308
332
|
### Fixed
|
309
333
|
|
310
334
|
- [internal] fixed deprecation warnings (flash-gordon)
|
311
335
|
|
336
|
+
|
312
337
|
[Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-validation/compare/v0.12.0...v0.12.1)
|
313
338
|
|
314
|
-
|
339
|
+
## 0.12.0 2018-05-31
|
340
|
+
|
315
341
|
|
316
342
|
### Changed
|
317
343
|
|
@@ -320,7 +346,8 @@ Complete rewrite on top of `dry-schema`.
|
|
320
346
|
|
321
347
|
[Compare v0.11.1...v0.12.0](https://github.com/dry-rb/dry-validation/compare/v0.11.1...v0.12.0)
|
322
348
|
|
323
|
-
|
349
|
+
## 0.11.1 2017-09-15
|
350
|
+
|
324
351
|
|
325
352
|
### Changed
|
326
353
|
|
@@ -329,7 +356,8 @@ Complete rewrite on top of `dry-schema`.
|
|
329
356
|
|
330
357
|
[Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-validation/compare/v0.11.0...v0.11.1)
|
331
358
|
|
332
|
-
|
359
|
+
## 0.11.0 2017-05-30
|
360
|
+
|
333
361
|
|
334
362
|
### Changed
|
335
363
|
|
@@ -337,32 +365,39 @@ Complete rewrite on top of `dry-schema`.
|
|
337
365
|
|
338
366
|
[Compare v0.10.7...v0.11.0](https://github.com/dry-rb/dry-validation/compare/v0.10.7...v0.11.0)
|
339
367
|
|
340
|
-
|
368
|
+
## 0.10.7 2017-05-15
|
369
|
+
|
341
370
|
|
342
371
|
### Fixed
|
343
372
|
|
344
373
|
- `validate` can now be defined multiple times for the same key (kimquy)
|
345
374
|
- Re-using rules between schemas no longer mutates original rule set (pabloh)
|
346
375
|
|
376
|
+
|
347
377
|
[Compare v0.10.6...v0.10.7](https://github.com/dry-rb/dry-validation/compare/v0.10.6...v0.10.7)
|
348
378
|
|
349
|
-
|
379
|
+
## 0.10.6 2017-04-26
|
380
|
+
|
350
381
|
|
351
382
|
### Fixed
|
352
383
|
|
353
384
|
- Fixes issue with wrong localized error messages when namespaced messages are used (kbredemeier)
|
354
385
|
|
386
|
+
|
355
387
|
[Compare v0.10.5...v0.10.6](https://github.com/dry-rb/dry-validation/compare/v0.10.5...v0.10.6)
|
356
388
|
|
357
|
-
|
389
|
+
## 0.10.5 2017-01-12
|
390
|
+
|
358
391
|
|
359
392
|
### Fixed
|
360
393
|
|
361
394
|
- Warnings under MRI 2.4.0 are gone (koic)
|
362
395
|
|
396
|
+
|
363
397
|
[Compare v0.10.4...v0.10.5](https://github.com/dry-rb/dry-validation/compare/v0.10.4...v0.10.5)
|
364
398
|
|
365
|
-
|
399
|
+
## 0.10.4 2016-12-03
|
400
|
+
|
366
401
|
|
367
402
|
### Fixed
|
368
403
|
|
@@ -375,31 +410,38 @@ Complete rewrite on top of `dry-schema`.
|
|
375
410
|
|
376
411
|
[Compare v0.10.3...v0.10.4](https://github.com/dry-rb/dry-validation/compare/v0.10.3...v0.10.4)
|
377
412
|
|
378
|
-
|
413
|
+
## 0.10.3 2016-09-27
|
414
|
+
|
379
415
|
|
380
416
|
### Fixed
|
381
417
|
|
382
418
|
- Custom predicates work correctly with `each` macro (solnic)
|
383
419
|
|
420
|
+
|
384
421
|
[Compare v0.10.2...v0.10.3](https://github.com/dry-rb/dry-validation/compare/v0.10.2...v0.10.3)
|
385
422
|
|
386
|
-
|
423
|
+
## 0.10.2 2016-09-23
|
424
|
+
|
387
425
|
|
388
426
|
### Fixed
|
389
427
|
|
390
428
|
- Constrained types + hints work again (solnic)
|
391
429
|
|
430
|
+
|
392
431
|
[Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-validation/compare/v0.10.1...v0.10.2)
|
393
432
|
|
394
|
-
|
433
|
+
## 0.10.1 2016-09-22
|
434
|
+
|
395
435
|
|
396
436
|
### Fixed
|
397
437
|
|
398
438
|
- Remove obsolete require of `dry/struct` which is now an optional extension (flash-gordon)
|
399
439
|
|
440
|
+
|
400
441
|
[Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-validation/compare/v0.10.0...v0.10.1)
|
401
442
|
|
402
|
-
|
443
|
+
## 0.10.0 2016-09-21
|
444
|
+
|
403
445
|
|
404
446
|
### Added
|
405
447
|
|
@@ -422,34 +464,31 @@ Complete rewrite on top of `dry-schema`.
|
|
422
464
|
- [BREAKING] `when` macro no longer supports multiple disconnected rules in its block, whatever the block returns will be used for the implication (solnic)
|
423
465
|
- [BREAKING] `rule(some_name: %i(some keys))` will _always_ use `:some_name` as the key for failure messages (solnic)
|
424
466
|
|
425
|
-
### Internal
|
426
|
-
|
427
|
-
- ~2 x performance boost (solnic)
|
428
|
-
- Rule AST was updated to latest dry-logic (solnic)
|
429
|
-
- `MessageCompiler` was drastically simplified based on the new result AST from dry-logic (solnic)
|
430
|
-
- `HintCompiler` is gone as hints are now part of the result AST (solnic)
|
431
|
-
- `maybe` macro creates an implication instead of a disjunction (`not(none?).then(*your-predicates)`) (solnic)
|
432
|
-
|
433
467
|
[Compare v0.9.5...v0.10.0](https://github.com/dry-rb/dry-validation/compare/v0.9.5...v0.10.0)
|
434
468
|
|
435
|
-
|
469
|
+
## 0.9.5 2016-08-16
|
470
|
+
|
436
471
|
|
437
472
|
### Fixed
|
438
473
|
|
439
474
|
- Infering multiple predicates with options works as expected ie `value(:str?, min_size?: 3, max_size?: 6)` (solnic)
|
440
475
|
- Default `locale` configured in `I18n` is now respected by the messages compiler (agustin + cavi21)
|
441
476
|
|
477
|
+
|
442
478
|
[Compare v0.9.4...v0.9.5](https://github.com/dry-rb/dry-validation/compare/v0.9.4...v0.9.5)
|
443
479
|
|
444
|
-
|
480
|
+
## 0.9.4 2016-08-11
|
481
|
+
|
445
482
|
|
446
483
|
### Fixed
|
447
484
|
|
448
485
|
- Error messages for sibling deeply nested schemas are nested correctly (timriley)
|
449
486
|
|
487
|
+
|
450
488
|
[Compare v0.9.3...v0.9.4](https://github.com/dry-rb/dry-validation/compare/v0.9.3...v0.9.4)
|
451
489
|
|
452
|
-
|
490
|
+
## 0.9.3 2016-07-22
|
491
|
+
|
453
492
|
|
454
493
|
### Added
|
455
494
|
|
@@ -467,24 +506,29 @@ Complete rewrite on top of `dry-schema`.
|
|
467
506
|
|
468
507
|
[Compare v0.9.2...v0.9.3](https://github.com/dry-rb/dry-validation/compare/v0.9.2...v0.9.3)
|
469
508
|
|
470
|
-
|
509
|
+
## 0.9.2 2016-07-13
|
510
|
+
|
471
511
|
|
472
512
|
### Fixed
|
473
513
|
|
474
514
|
- Constrained types now work with `each` macro (solnic)
|
475
515
|
- Array coercion without member type works now ie `required(:arr).maybe(:array?)` (solnic)
|
476
516
|
|
517
|
+
|
477
518
|
[Compare v0.9.1...v0.9.2](https://github.com/dry-rb/dry-validation/compare/v0.9.1...v0.9.2)
|
478
519
|
|
479
|
-
|
520
|
+
## 0.9.1 2016-07-11
|
521
|
+
|
480
522
|
|
481
523
|
### Fixed
|
482
524
|
|
483
525
|
- `I18n` backend is no longer required and set by default (solnic)
|
484
526
|
|
527
|
+
|
485
528
|
[Compare v0.9.0...v0.9.1](https://github.com/dry-rb/dry-validation/compare/v0.9.0...v0.9.1)
|
486
529
|
|
487
|
-
|
530
|
+
## 0.9.0 2016-07-08
|
531
|
+
|
488
532
|
|
489
533
|
### Added
|
490
534
|
|
@@ -497,10 +541,6 @@ Complete rewrite on top of `dry-schema`.
|
|
497
541
|
- Support for message token transformations in custom predicates (fran-worley)
|
498
542
|
- [EXPERIMENTAL] Ability to compose predicates that accept dynamic args provided by the schema (solnic)
|
499
543
|
|
500
|
-
### Changed
|
501
|
-
|
502
|
-
- Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
|
503
|
-
|
504
544
|
### Fixed
|
505
545
|
|
506
546
|
- Duped key names in nested schemas no longer result in invalid error messages structure (solnic)
|
@@ -510,18 +550,14 @@ Complete rewrite on top of `dry-schema`.
|
|
510
550
|
- Hints for elements are no longer provided for an array when the value is not an array (solnic)
|
511
551
|
- `input` macro no longer messes up error messages for nested structures (solnic)
|
512
552
|
|
513
|
-
###
|
553
|
+
### Changed
|
514
554
|
|
515
|
-
-
|
516
|
-
- Refactored Error and Hint compilers (solnic)
|
517
|
-
- Refactored Schema to use an internal executor objects with steps (solnic)
|
518
|
-
- Extracted root-rule into a separate validation step (solnic)
|
519
|
-
- Added `MessageSet` that result objects now use (in 1.0.0 it'll be exposed via public API) (solnic)
|
520
|
-
- We can now distinguish error messages from validation hints via `Message` and `Hint` objects (solnic)
|
555
|
+
- Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
|
521
556
|
|
522
557
|
[Compare v0.8.0...v0.9.0](https://github.com/dry-rb/dry-validation/compare/v0.8.0...v0.9.0)
|
523
558
|
|
524
|
-
|
559
|
+
## 0.8.0 2016-07-01
|
560
|
+
|
525
561
|
|
526
562
|
### Added
|
527
563
|
|
@@ -567,19 +603,10 @@ Complete rewrite on top of `dry-schema`.
|
|
567
603
|
- Deprecate key in favor of required (coop)
|
568
604
|
- Remove nested key syntax (solnic)
|
569
605
|
|
570
|
-
### Internal
|
571
|
-
|
572
|
-
- ~15% performance boost via various optimizations (solnic)
|
573
|
-
- When using explicit type specs building a schema is ~80-85x faster (solnic)
|
574
|
-
- No longer uses `Dry::Types::Predicates` as `:type?` predicate was moved to dry-logic (solnic)
|
575
|
-
- Integration specs covering predicates with Form and Schema (jodosha)
|
576
|
-
- Use latest ruby versions on travis (flash-gordon)
|
577
|
-
- Make pry console optional with IRB as a default (flash-gordon)
|
578
|
-
- Remove wrapping rules in :set nodes (solnic)
|
579
|
-
|
580
606
|
[Compare v0.7.4...v0.8.0](https://github.com/dry-rb/dry-validation/compare/v0.7.4...v0.8.0)
|
581
607
|
|
582
|
-
|
608
|
+
## 0.7.4 2016-04-06
|
609
|
+
|
583
610
|
|
584
611
|
### Added
|
585
612
|
|
@@ -590,9 +617,11 @@ Complete rewrite on top of `dry-schema`.
|
|
590
617
|
|
591
618
|
- Depending on deeply nested values in high-level rules works now (solnic)
|
592
619
|
|
620
|
+
|
593
621
|
[Compare v0.7.3...v0.7.4](https://github.com/dry-rb/dry-validation/compare/v0.7.3...v0.7.4)
|
594
622
|
|
595
|
-
|
623
|
+
## 0.7.3 2016-03-30
|
624
|
+
|
596
625
|
|
597
626
|
### Added
|
598
627
|
|
@@ -605,22 +634,22 @@ Complete rewrite on top of `dry-schema`.
|
|
605
634
|
- Creating a nested schema properly sets full path to nested data structure (solnic)
|
606
635
|
- Error message for `empty?` predicate is now correct (jodosha)
|
607
636
|
|
608
|
-
### Internal
|
609
|
-
|
610
|
-
- Switch from `thread_safe` to `concurrent` (joevandyk)
|
611
637
|
|
612
638
|
[Compare v0.7.2...v0.7.3](https://github.com/dry-rb/dry-validation/compare/v0.7.2...v0.7.3)
|
613
639
|
|
614
|
-
|
640
|
+
## 0.7.2 2016-03-28
|
641
|
+
|
615
642
|
|
616
643
|
### Added
|
617
644
|
|
618
645
|
- Support for nested schemas inside high-level rules (solnic)
|
619
646
|
- `Schema#to_proc` so that you can do `data.each(&schema)` (solnic)
|
620
647
|
|
648
|
+
|
621
649
|
[Compare v0.7.1...v0.7.2](https://github.com/dry-rb/dry-validation/compare/v0.7.1...v0.7.2)
|
622
650
|
|
623
|
-
|
651
|
+
## 0.7.1 2016-03-21
|
652
|
+
|
624
653
|
|
625
654
|
### Added
|
626
655
|
|
@@ -638,7 +667,8 @@ Complete rewrite on top of `dry-schema`.
|
|
638
667
|
|
639
668
|
[Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-validation/compare/v0.7.0...v0.7.1)
|
640
669
|
|
641
|
-
|
670
|
+
## 0.7.0 2016-03-16
|
671
|
+
|
642
672
|
|
643
673
|
### Added
|
644
674
|
|
@@ -662,6 +692,12 @@ Complete rewrite on top of `dry-schema`.
|
|
662
692
|
- `Validation::Result` responds to `#[]` and `#each` (delegating to its output)
|
663
693
|
and it's an enumerable (solnic)
|
664
694
|
|
695
|
+
### Fixed
|
696
|
+
|
697
|
+
- Qualified rule names properly use last node by default for error messages (solnic)
|
698
|
+
- Validation hints only include relevant messages (solnic)
|
699
|
+
- `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
|
700
|
+
|
665
701
|
### Changed
|
666
702
|
|
667
703
|
- `schema` was **removed** from the DSL, just use `key(:name).schema` instead (solnic)
|
@@ -672,15 +708,10 @@ Complete rewrite on top of `dry-schema`.
|
|
672
708
|
- `Schema::Result` is now `Validation::Result` and it no longer has success and
|
673
709
|
failure results, only error results are provided (solnic)
|
674
710
|
|
675
|
-
### Fixed
|
676
|
-
|
677
|
-
- Qualified rule names properly use last node by default for error messages (solnic)
|
678
|
-
- Validation hints only include relevant messages (solnic)
|
679
|
-
- `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
|
680
|
-
|
681
711
|
[Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-validation/compare/v0.6.0...v0.7.0)
|
682
712
|
|
683
|
-
|
713
|
+
## 0.6.0 2016-01-20
|
714
|
+
|
684
715
|
|
685
716
|
### Added
|
686
717
|
|
@@ -691,38 +722,41 @@ Complete rewrite on top of `dry-schema`.
|
|
691
722
|
- Support for `confirmation(:foo, some_predicate: some_argument)` shortcut syntax (solnic)
|
692
723
|
- Support for error messages for grouped rules (like `confirmation`) (solnic)
|
693
724
|
- Schemas support injecting rules from the outside (solnic)
|
694
|
-
|
695
|
-
## Changed
|
696
|
-
|
725
|
+
- ## Changed
|
697
726
|
- `rule` uses objects that inherit from `BasicObject` to avoid conflicts with
|
698
727
|
predicate names and built-in `Object` methods (solnic)
|
699
728
|
- In `Schema::Form` both `key` and `optional` will apply `filled?` predicate by
|
700
729
|
default when no block is passed (solnic)
|
701
730
|
|
702
|
-
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-validation/compare/v0.5.0...v0.6.0)
|
703
731
|
|
704
|
-
|
732
|
+
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-validation/compare/v0.5.0...v0.6.0)
|
705
733
|
|
706
|
-
|
734
|
+
## 0.5.0 2016-01-11
|
707
735
|
|
708
|
-
- Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
|
709
|
-
- `dry/validation/schema/form` is now required by default (solnic)
|
710
736
|
|
711
737
|
### Fixed
|
712
738
|
|
713
739
|
- `Schema::Form` uses safe `form.array` and `form.hash` types which fixes #42 (solnic)
|
714
740
|
|
741
|
+
### Changed
|
742
|
+
|
743
|
+
- Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
|
744
|
+
- `dry/validation/schema/form` is now required by default (solnic)
|
745
|
+
|
715
746
|
[Compare v0.4.1...v0.5.0](https://github.com/dry-rb/dry-validation/compare/v0.4.1...v0.5.0)
|
716
747
|
|
717
|
-
|
748
|
+
## 0.4.1 2015-12-27
|
749
|
+
|
718
750
|
|
719
751
|
### Added
|
720
752
|
|
721
753
|
- Support for `each` and type coercion inference in `Schema::Form` (solnic)
|
722
754
|
|
755
|
+
|
723
756
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-validation/compare/v0.4.0...v0.4.1)
|
724
757
|
|
725
|
-
|
758
|
+
## 0.4.0 2015-12-21
|
759
|
+
|
726
760
|
|
727
761
|
### Added
|
728
762
|
|
@@ -736,9 +770,11 @@ Complete rewrite on top of `dry-schema`.
|
|
736
770
|
|
737
771
|
- Error messages hash has now consistent structure `rule_name => [msgs_array, input_value]` (solnic)
|
738
772
|
|
773
|
+
|
739
774
|
[Compare v0.3.1...v0.4.0](https://github.com/dry-rb/dry-validation/compare/v0.3.1...v0.4.0)
|
740
775
|
|
741
|
-
|
776
|
+
## 0.3.1 2015-12-08
|
777
|
+
|
742
778
|
|
743
779
|
### Added
|
744
780
|
|
@@ -748,9 +784,11 @@ Complete rewrite on top of `dry-schema`.
|
|
748
784
|
|
749
785
|
- Error compiler returns an empty hash rather than a nil when there are no errors (solnic)
|
750
786
|
|
787
|
+
|
751
788
|
[Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-validation/compare/v0.3.0...v0.3.1)
|
752
789
|
|
753
|
-
|
790
|
+
## 0.3.0 2015-12-07
|
791
|
+
|
754
792
|
|
755
793
|
### Added
|
756
794
|
|
@@ -772,9 +810,10 @@ Complete rewrite on top of `dry-schema`.
|
|
772
810
|
errors and messages
|
773
811
|
- `Schema::Result#messages` returns a hash with rule names, messages and input values (solnic)
|
774
812
|
|
775
|
-
[Compare v0.2.0...
|
813
|
+
[Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-validation/compare/v0.2.0...v0.3.0)
|
814
|
+
|
815
|
+
## 0.2.0 2015-11-30
|
776
816
|
|
777
|
-
# v0.2.0 2015-11-30
|
778
817
|
|
779
818
|
### Added
|
780
819
|
|
@@ -795,8 +834,9 @@ Complete rewrite on top of `dry-schema`.
|
|
795
834
|
|
796
835
|
- Added missing `and` / `or` interfaces to composite rules (solnic)
|
797
836
|
|
798
|
-
[Compare v0.1.0...HEAD](https://github.com/dry-rb/dry-validation/compare/v0.1.0...HEAD)
|
799
837
|
|
800
|
-
|
838
|
+
[Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-validation/compare/v0.1.0...v0.2.0)
|
839
|
+
|
840
|
+
## 0.1.0 2015-11-25
|
801
841
|
|
802
842
|
First public release
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# this file is managed by dry-rb/devtools project
|
3
|
+
|
4
|
+
lib = File.expand_path('lib', __dir__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
require 'dry/validation/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = 'dry-validation'
|
10
|
+
spec.authors = ["Piotr Solnica"]
|
11
|
+
spec.email = ["piotr.solnica@gmail.com"]
|
12
|
+
spec.license = 'MIT'
|
13
|
+
spec.version = Dry::Validation::VERSION.dup
|
14
|
+
|
15
|
+
spec.summary = "Validation library"
|
16
|
+
spec.description = spec.summary
|
17
|
+
spec.homepage = 'https://dry-rb.org/gems/dry-validation'
|
18
|
+
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-validation.gemspec", "lib/**/*", "config/*.yml"]
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
|
+
spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-validation/blob/master/CHANGELOG.md'
|
23
|
+
spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-validation'
|
24
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-validation/issues'
|
25
|
+
|
26
|
+
spec.required_ruby_version = '>= 2.4.0'
|
27
|
+
|
28
|
+
# to update dependencies edit project.yml
|
29
|
+
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
30
|
+
spec.add_runtime_dependency "dry-container", "~> 0.7", ">= 0.7.1"
|
31
|
+
spec.add_runtime_dependency "dry-core", "~> 0.4"
|
32
|
+
spec.add_runtime_dependency "dry-equalizer", "~> 0.2"
|
33
|
+
spec.add_runtime_dependency "dry-initializer", "~> 3.0"
|
34
|
+
spec.add_runtime_dependency "dry-schema", "~> 1.4", ">= 1.4.3"
|
35
|
+
|
36
|
+
spec.add_development_dependency "bundler"
|
37
|
+
spec.add_development_dependency "rake"
|
38
|
+
spec.add_development_dependency "rspec"
|
39
|
+
end
|
data/lib/dry/validation/rule.rb
CHANGED
@@ -118,12 +118,18 @@ module Dry
|
|
118
118
|
args.each_with_object([]) do |spec, macros|
|
119
119
|
case spec
|
120
120
|
when Hash
|
121
|
-
|
121
|
+
add_macro_from_hash(macros, spec)
|
122
122
|
else
|
123
123
|
macros << Array(spec)
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
127
|
+
|
128
|
+
def add_macro_from_hash(macros, spec)
|
129
|
+
spec.each do |k, v|
|
130
|
+
macros << [k, v.is_a?(Array) ? v : [v]]
|
131
|
+
end
|
132
|
+
end
|
127
133
|
end
|
128
134
|
end
|
129
135
|
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.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -25,53 +25,53 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: dry-
|
28
|
+
name: dry-container
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.7'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.7.1
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
43
|
+
version: '0.7'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.7.1
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: dry-
|
48
|
+
name: dry-core
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
53
|
+
version: '0.4'
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
60
|
+
version: '0.4'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: dry-
|
62
|
+
name: dry-equalizer
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 0.7.1
|
67
|
+
version: '0.2'
|
65
68
|
type: :runtime
|
66
69
|
prerelease: false
|
67
70
|
version_requirements: !ruby/object:Gem::Requirement
|
68
71
|
requirements:
|
69
72
|
- - "~>"
|
70
73
|
- !ruby/object:Gem::Version
|
71
|
-
version: '0.
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.7.1
|
74
|
+
version: '0.2'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: dry-initializer
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,7 +92,7 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '1.
|
95
|
+
version: '1.4'
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: 1.4.3
|
@@ -102,7 +102,7 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - "~>"
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: '1.
|
105
|
+
version: '1.4'
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: 1.4.3
|
@@ -148,7 +148,7 @@ dependencies:
|
|
148
148
|
- - ">="
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
|
-
description:
|
151
|
+
description: Validation library
|
152
152
|
email:
|
153
153
|
- piotr.solnica@gmail.com
|
154
154
|
executables: []
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- LICENSE
|
160
160
|
- README.md
|
161
161
|
- config/errors.yml
|
162
|
+
- dry-validation.gemspec
|
162
163
|
- lib/dry-validation.rb
|
163
164
|
- lib/dry/validation.rb
|
164
165
|
- lib/dry/validation/config.rb
|
@@ -184,7 +185,11 @@ files:
|
|
184
185
|
homepage: https://dry-rb.org/gems/dry-validation
|
185
186
|
licenses:
|
186
187
|
- MIT
|
187
|
-
metadata:
|
188
|
+
metadata:
|
189
|
+
allowed_push_host: https://rubygems.org
|
190
|
+
changelog_uri: https://github.com/dry-rb/dry-validation/blob/master/CHANGELOG.md
|
191
|
+
source_code_uri: https://github.com/dry-rb/dry-validation
|
192
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-validation/issues
|
188
193
|
post_install_message:
|
189
194
|
rdoc_options: []
|
190
195
|
require_paths:
|
@@ -193,14 +198,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
193
198
|
requirements:
|
194
199
|
- - ">="
|
195
200
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
201
|
+
version: 2.4.0
|
197
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
203
|
requirements:
|
199
204
|
- - ">="
|
200
205
|
- !ruby/object:Gem::Version
|
201
206
|
version: '0'
|
202
207
|
requirements: []
|
203
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.0.3
|
204
209
|
signing_key:
|
205
210
|
specification_version: 4
|
206
211
|
summary: Validation library
|