dry-validation 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 335dfa8db4764cd1c86619371fea202bfeb0c80cf9a84a2069d7fe4c92a1f5af
4
+ data.tar.gz: 851e5d59e8c4a1c9ce338d5e3fb01b02159da120fb2a775bcec5168ac705c20e
5
+ SHA512:
6
+ metadata.gz: 1da1b675edac12c4d7256cb15b770a87387ffc352330434db7a82f177c65ce21dcc8a4803fce2be1d85d29be8df26979fe6e91d43111cebe04c6875500523c29
7
+ data.tar.gz: 102cf75e197be20843af749584c2a6abd57ce8334d940bff7dd06dc4e37c54fd451bb244dc3365bca913334e3b0c3b3bd391c68b3f9c4e13c4da6efb9c69213f
@@ -0,0 +1,892 @@
1
+ ## 1.5.3 2020-07-27
2
+
3
+
4
+ ### Added
5
+
6
+ - You can now access current value's index via `rule(:foo).each do |index:|` (issue #606 done via #657) (@mrbongiolo)
7
+
8
+ ### Changed
9
+
10
+ - `Result#error?` is now a public API and it takes into consideration both schema and rule errors (issue #655 fixed via #656) (@PragTob)
11
+
12
+ [Compare v1.5.2...v1.5.3](https://github.com/dry-rb/dry-validation/compare/v1.5.2...v1.5.3)
13
+
14
+ ## 1.5.2 2020-07-14
15
+
16
+
17
+ ### Fixed
18
+
19
+ - `key?` predicate in rules no longer crashes when the rule path points to a non-existent array value (issue #653 fixed via #654) (@solnic)
20
+
21
+
22
+ [Compare v1.5.1...v1.5.2](https://github.com/dry-rb/dry-validation/compare/v1.5.1...v1.5.2)
23
+
24
+ ## 1.5.1 2020-06-18
25
+
26
+
27
+ ### Fixed
28
+
29
+ - dry-monads no longer required for the `:hints` extension (@schokomarie)
30
+ - Using `full: true` option works as expected with custom rule messages (issue #618 fixed via #651) (@sirfilip)
31
+ - Using `locale: ...` option works as expected with hints (issue #589 fixed via 652) (@sirfilip)
32
+
33
+
34
+ [Compare v1.5.0...v1.5.1](https://github.com/dry-rb/dry-validation/compare/v1.5.0...v1.5.1)
35
+
36
+ ## 1.5.0 2020-03-11
37
+
38
+
39
+ ### Added
40
+
41
+ - `schema_error?` rule helper (@waiting-for-dev)
42
+ - `rule_error?` rule helper (@waiting-for-dev)
43
+
44
+ ### Changed
45
+
46
+ - dry-schema dependency was bumped to `~> 1.5` (@solnic)
47
+ - [internal] `KeyMap` patches have been removed since dry-schema now provides required functionality (@solnic)
48
+
49
+ [Compare v1.4.2...v1.5.0](https://github.com/dry-rb/dry-validation/compare/v1.4.2...v1.5.0)
50
+
51
+ ## 1.4.2 2020-01-18
52
+
53
+
54
+ ### Fixed
55
+
56
+ - Macros using predicates that accept a range argument work as expected (no need to wrap the argument in an array) (@waiting-for-dev)
57
+
58
+
59
+ [Compare v1.4.1...v1.4.2](https://github.com/dry-rb/dry-validation/compare/v1.4.1...v1.4.2)
60
+
61
+ ## 1.4.1 2020-01-08
62
+
63
+
64
+ ### Added
65
+
66
+ - Pattern matching on result values (@flash-gordon)
67
+
68
+ ### Fixed
69
+
70
+ - List tokens are correctly interpolated as a comma separated list in rule messages (see #611) (@waiting-for-dev)
71
+ - Warnings about delegated keywords (@flash-gordon)
72
+
73
+
74
+ [Compare v1.4.0...v1.4.1](https://github.com/dry-rb/dry-validation/compare/v1.4.0...v1.4.1)
75
+
76
+ ## 1.4.0 2019-12-12
77
+
78
+
79
+ ### Added
80
+
81
+ - Support for multi-schema inheritance (@ianwhite)
82
+
83
+ ### Fixed
84
+
85
+ - Keyword warnings reported by Ruby 2.7 (@flash-gordon)
86
+ - Fixed an issue where `MessageSet` would be marked as empty too early (@ianwhite)
87
+ - Messages are correctly generated when there are errors for both an array and one or more of its elements (see #599) (@Bugagazavr)
88
+
89
+ ### Changed
90
+
91
+ - A meaningful exception is raised when failure options are not valid (@MatElGran)
92
+ - [internal] improved performance in `Contract.ensure_valid_keys` (@grzegorz-jakubiak)
93
+ - [internal] fixed keyword warnings on MRI 2.7.0 (@flash-gordon)
94
+
95
+ [Compare v1.3.1...v1.4.0](https://github.com/dry-rb/dry-validation/compare/v1.3.1...v1.4.0)
96
+
97
+ ## 1.3.1 2019-08-16
98
+
99
+
100
+ ### Changed
101
+
102
+ - You can now set an external schema without providing a block (@alassek)
103
+
104
+ [Compare v1.3.0...v1.3.1](https://github.com/dry-rb/dry-validation/compare/v1.3.0...v1.3.1)
105
+
106
+ ## 1.3.0 2019-08-14
107
+
108
+
109
+ ### Added
110
+
111
+ - Support for setting an external schema (that can be extended too) (fixed #574) (@solnic)
112
+
113
+ ### Fixed
114
+
115
+ - Using a hash spec to define rule keys with more than one value is properly handled by rule guard now (fixed #576) (@solnic)
116
+
117
+ ### Changed
118
+
119
+ - `values` within rules uses `Hash#fetch_values` internally now, which improves performance (@esparta)
120
+
121
+ [Compare v1.2.1...v1.3.0](https://github.com/dry-rb/dry-validation/compare/v1.2.1...v1.3.0)
122
+
123
+ ## 1.2.1 2019-07-16
124
+
125
+
126
+ ### Fixed
127
+
128
+ - Defining an abstract contract class that has no schema no longer crashes (issue #565) (@solnic)
129
+ - Fixed an issue where `Rule#each` would crash when the value is not an array (issue #567) (@solnic)
130
+ - Fixed an issue where guarding a rule would crash when keys are missing in the input (issue #569) (@solnic)
131
+ - Added missing "pathname" require (issue #570) (@solnic)
132
+
133
+
134
+ [Compare v1.2.0...v1.2.1](https://github.com/dry-rb/dry-validation/compare/v1.2.0...v1.2.1)
135
+
136
+ ## 1.2.0 2019-07-08
137
+
138
+
139
+ ### Added
140
+
141
+ - New extension `:predicates_as_macros` (@waiting-for-dev)
142
+
143
+ ### Fixed
144
+
145
+ - Guarding rules for nested keys works correctly (issue #560) (@solnic)
146
+
147
+ ### Changed
148
+
149
+ - `dry-schema` dependency was bumped to `>= 1.3.1` (@solnic)
150
+
151
+ [Compare v1.1.1...v1.2.0](https://github.com/dry-rb/dry-validation/compare/v1.1.1...v1.2.0)
152
+
153
+ ## 1.1.1 2019-06-24
154
+
155
+
156
+ ### Fixed
157
+
158
+ - `Rule#each` works with array values from nested hashes (@mustardnoise)
159
+
160
+
161
+ [Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-validation/compare/v1.1.0...v1.1.1)
162
+
163
+ ## 1.1.0 2019-06-14
164
+
165
+
166
+ ### Added
167
+
168
+ - `key?` method available within rules, that can be used to check if there's a value under the rule's default key (refs #540) (@solnic)
169
+ - `value` supports hash-based path specifications now (refs #547) (@solnic)
170
+ - `value` can read multiple values when the key points to them, ie in case of `rule(geo: [:lat, :lon])` it would return an array with `lat` and `lon` (@solnic)
171
+
172
+ ### Fixed
173
+
174
+ - Passing multiple macro names to `validate` or `each` works correctly (fixed #538 #541) (@jandudulski)
175
+
176
+
177
+ [Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.1.0)
178
+
179
+ ## 1.0.0 2019-06-10
180
+
181
+ 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).
182
+
183
+
184
+ [Compare v1.0.0...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.0.0)
185
+
186
+ ## 1.0.0 2019-06-10
187
+
188
+
189
+ ### Added
190
+
191
+ - Support for defining rules for each element of an array via `rule(:items).each { ... }` (solnic)
192
+ - Support for parameterized macros via `rule(:foo).validate(my_macro: :some_option)` (solnic)
193
+ - `values#[]` is now compatible with path specs (symbol, array with keys or dot-notation) (issue #528) (solnic)
194
+ - `value` shortcut for accessing the value found under the first key specified by a rule. ie `rule(:foo) { value }` returns `values[:foo]` (solnic)
195
+
196
+ ### Fixed
197
+
198
+ - Contract's `config.locale` option was replaced by `config.messages.default_locale` to avoid conflicts with run-time `:locale` option and/or whatever is set via `I18n` gem (solnic)
199
+ - Macros no longer mutate `Dry::Validation::Contract.macros` when using inheritance (solnic)
200
+ - Missing dependency on `dry-container` was added (solnic)
201
+
202
+ ### Changed
203
+
204
+ - `rule` will raise `InvalidKeysError` when specified keys are not defined by the schema (solnic)
205
+ - `Contract.new` will raise `SchemaMissingError` when the class doesn't have schema defined (solnic)
206
+ - Contracts no longer support `:locale` option in the constructor. Use `Result#errors(locale: :pl)` to change locale at run-time (solnic)
207
+
208
+ [Compare v1.0.0.rc3...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc3...v1.0.0)
209
+
210
+ ## 1.0.0.rc3 2019-05-06
211
+
212
+
213
+ ### Added
214
+
215
+ - [EXPERIMENTAL] `Validation.register_macro` for registering global macros (solnic)
216
+ - [EXPERIMENTAL] `Contract.register_macro` for registering macros available to specific contract classes (solnic)
217
+ - `Dry::Validation.Contract` shortcut for quickly defining a contract and getting its instance back (solnic)
218
+ - New configuration option `config.locale` for setting the default locale (solnic)
219
+
220
+ ### Fixed
221
+
222
+ - `config/errors.yml` are now bundled with the gem, **`rc2` was broken because of this** (solnic)
223
+
224
+
225
+ [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)
226
+
227
+ ## 1.0.0.rc2 2019-05-04
228
+
229
+ 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`.
230
+
231
+ ### Added
232
+
233
+ - [EXPERIMENTAL] support for registering macros via `Dry::Validation::Macros.register(:your_macro, &block)` (solnic)
234
+ - [EXPERIMENTAL] `:acceptance` as the first built-in macro (issue #157) (solnic)
235
+
236
+ ### Fixed
237
+
238
+ - Passing invalid argument to `failure` will raise a meaningful error instead of crashing (solnic)
239
+
240
+ ### Changed
241
+
242
+ - In rule validation blocks, `values` is now an instance of a hash-like `Dry::Validation::Values` class, rather than `Dry::Schema::Result`. This gives more convenient access to data within rules (solnic)
243
+ - Dependency on `dry-schema` was updated to `~> 1.0` (solnic)
244
+
245
+ [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)
246
+
247
+ ## 1.0.0.rc1 2019-04-26
248
+
249
+
250
+ ### Added
251
+
252
+ - `:hints` extension is back (solnic)
253
+ - `Result` objects have access to the context object which is shared between rules (flash-gordon)
254
+
255
+ ### Fixed
256
+
257
+ - Multiple hint messages no longer crash message set (flash-gordon)
258
+ - `Contract#inspect` no longer crashes (solnic)
259
+
260
+ ### Changed
261
+
262
+ - Dependency on `dry-schema` was bumped to `~> 0.6` - this pulls in `dry-types 1.0.0` and `dry-logic 1.0.0` (solnic)
263
+ - Dependency on `dry-initializer` was bumped to `~> 3.0` (solnic)
264
+
265
+ [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)
266
+
267
+ ## 1.0.0.beta2 2019-04-04
268
+
269
+
270
+ ### Added
271
+
272
+ - Support for arbitrary meta-data in failures, ie:
273
+
274
+ ```ruby
275
+ class NewUserContract < Dry::Validation::Contract
276
+ params do
277
+ required(:login).filled(:string)
278
+ end
279
+
280
+ rule(:login) do
281
+ key.failure(text: 'is taken', code: 123) unless db.unique?(values[:login])
282
+ end
283
+ end
284
+ ```
285
+
286
+ Now your error hash will include `{ login: [{ text: 'is taken', code: 123 }] }` (solnic + flash-gordon)
287
+
288
+ ### Changed
289
+
290
+ - [BREAKING] `Error` was renamed to `Message` as it is a more generic concept (solnic)
291
+ - [BREAKING] `ErrorSet` was renamed to `MessageSet` for consistency (solnic)
292
+ - [BREAKING] `:monads` extension wraps entire result objects in `Success` or `Failure` (flash-gordon)
293
+
294
+ [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)
295
+
296
+ ## 1.0.0.beta1 2019-03-26
297
+
298
+
299
+ ### Added
300
+
301
+ - New API for setting failures `base.failure` for base errors and `key.failure` for key errors (solnic)
302
+ - Support for `base` errors associated with a key even when child keys have errors too (solnic)
303
+ - Support for `base` errors not associated with any key (solnic)
304
+ - Result objects use `ErrorSet` object now for managing messages (solnic)
305
+ - Nested keys are properly handled when generating messages hash (issue #489) (flash-gordon + solnic)
306
+ - Result objects support `locale` and `full` options now (solnic)
307
+ - Ability to configure `top_namespace` for messages, which will be used for both schema and rule localization (solnic)
308
+ - Rule blocks receive a context object that you can use to share data between rules (solnic)
309
+
310
+ ### Changed
311
+
312
+ - [BREAKING] `Result#errors` returns an instance of `ErrorSet` now, it's an enumerable, coerible to a hash (solnic)
313
+ - [BREAKING] `failure` was removed in favor of `key.failure` or `key(:foo).failure` (solnic)
314
+ - [BREAKING] `Result#to_hash` was removed (flash-gordon)
315
+
316
+ [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)
317
+
318
+ ## 1.0.0.alpha2 2019-03-05
319
+
320
+ First round of bug fixes. Thanks for testing <3!
321
+
322
+ ### Fixed
323
+
324
+ - Errors with nested messages are correctly built (flash-gordon)
325
+ - Messages for nested keys are correctly resolved (solnic)
326
+ - A message for a nested key is resolved when it's defined under `errors.rule.%{key}` too, but a message under nested key will override it (solnic)
327
+
328
+ ### Changed
329
+
330
+ - When a message template is not found a more meaningful error is raised that includes both rule identifier and key path (solnic)
331
+
332
+ [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)
333
+
334
+ ## 1.0.0.alpha1 2019-03-04
335
+
336
+ Complete rewrite on top of `dry-schema`.
337
+
338
+ ### Added
339
+
340
+ - [BREAKING] `Dry::Validation::Contract` as a replacement for validation schemas (solnic)
341
+ - [BREAKING] New `rule` DSL with an improved API for setting error messages (solnic)
342
+
343
+
344
+ [Compare v0.13.0...v1.0.0.alpha1](https://github.com/dry-rb/dry-validation/compare/v0.13.0...v1.0.0.alpha1)
345
+
346
+ ## 0.13.0 2019-01-29
347
+
348
+
349
+ ### Fixed
350
+
351
+ - Warning about method redefined (amatsuda)
352
+
353
+ ### Changed
354
+
355
+ - `dry-logic` was bumped to `~> 0.5` (solnic)
356
+ - `dry-types` was bumped to `~> 0.14` (solnic)
357
+
358
+ [Compare v0.12.3...v0.13.0](https://github.com/dry-rb/dry-validation/compare/v0.12.3...v0.13.0)
359
+
360
+ ## 0.12.3 2019-01-29
361
+
362
+
363
+ ### Changed
364
+
365
+ - [internal] dry-logic was pinned to `~> 0.4.2` (flash-gordon)
366
+
367
+ [Compare v0.12.2...v0.12.3](https://github.com/dry-rb/dry-validation/compare/v0.12.2...v0.12.3)
368
+
369
+ ## 0.12.2 2018-08-29
370
+
371
+
372
+ ### Fixed
373
+
374
+ - Use correct key names for rule messages when using i18n (jozzi05)
375
+
376
+
377
+ [Compare v0.12.1...v0.12.2](https://github.com/dry-rb/dry-validation/compare/v0.12.1...v0.12.2)
378
+
379
+ ## 0.12.1 2018-07-06
380
+
381
+
382
+ ### Fixed
383
+
384
+ - [internal] fixed deprecation warnings (flash-gordon)
385
+
386
+
387
+ [Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-validation/compare/v0.12.0...v0.12.1)
388
+
389
+ ## 0.12.0 2018-05-31
390
+
391
+
392
+ ### Changed
393
+
394
+ - Code updated to work with `dry-types` 0.13.1 and `dry-struct` 0.5.0, these are now minimal supported versions (flash-gordon)
395
+ - [BREAKING] `Form` was renamed to `Params` to be consistent with the latest changes from `dry-types`. You can `require 'dry/validation/compat/form'` to use the previous names but it will be removed in the next version (flash-gordon)
396
+
397
+ [Compare v0.11.1...v0.12.0](https://github.com/dry-rb/dry-validation/compare/v0.11.1...v0.12.0)
398
+
399
+ ## 0.11.1 2017-09-15
400
+
401
+
402
+ ### Changed
403
+
404
+ - `Result#to_either` was renamed to `#to_monad`, the previous name is kept for backward compatibility (flash-gordon)
405
+ - [internal] fix warnings from dry-types v0.12.0
406
+
407
+ [Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-validation/compare/v0.11.0...v0.11.1)
408
+
409
+ ## 0.11.0 2017-05-30
410
+
411
+
412
+ ### Changed
413
+
414
+ - [internal] input processor compilers have been updated to work with new dry-types' AST (GustavoCaso)
415
+
416
+ [Compare v0.10.7...v0.11.0](https://github.com/dry-rb/dry-validation/compare/v0.10.7...v0.11.0)
417
+
418
+ ## 0.10.7 2017-05-15
419
+
420
+
421
+ ### Fixed
422
+
423
+ - `validate` can now be defined multiple times for the same key (kimquy)
424
+ - Re-using rules between schemas no longer mutates original rule set (pabloh)
425
+
426
+
427
+ [Compare v0.10.6...v0.10.7](https://github.com/dry-rb/dry-validation/compare/v0.10.6...v0.10.7)
428
+
429
+ ## 0.10.6 2017-04-26
430
+
431
+
432
+ ### Fixed
433
+
434
+ - Fixes issue with wrong localized error messages when namespaced messages are used (kbredemeier)
435
+
436
+
437
+ [Compare v0.10.5...v0.10.6](https://github.com/dry-rb/dry-validation/compare/v0.10.5...v0.10.6)
438
+
439
+ ## 0.10.5 2017-01-12
440
+
441
+
442
+ ### Fixed
443
+
444
+ - Warnings under MRI 2.4.0 are gone (koic)
445
+
446
+
447
+ [Compare v0.10.4...v0.10.5](https://github.com/dry-rb/dry-validation/compare/v0.10.4...v0.10.5)
448
+
449
+ ## 0.10.4 2016-12-03
450
+
451
+
452
+ ### Fixed
453
+
454
+ - Updated to dry-core >= 0.2.1 (ruby warnings are gone) (flash-gordon)
455
+ - `format?` predicate is excluded from hints (solnic)
456
+
457
+ ### Changed
458
+
459
+ - `version` file is now required by default (georgemillo)
460
+
461
+ [Compare v0.10.3...v0.10.4](https://github.com/dry-rb/dry-validation/compare/v0.10.3...v0.10.4)
462
+
463
+ ## 0.10.3 2016-09-27
464
+
465
+
466
+ ### Fixed
467
+
468
+ - Custom predicates work correctly with `each` macro (solnic)
469
+
470
+
471
+ [Compare v0.10.2...v0.10.3](https://github.com/dry-rb/dry-validation/compare/v0.10.2...v0.10.3)
472
+
473
+ ## 0.10.2 2016-09-23
474
+
475
+
476
+ ### Fixed
477
+
478
+ - Constrained types + hints work again (solnic)
479
+
480
+
481
+ [Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-validation/compare/v0.10.1...v0.10.2)
482
+
483
+ ## 0.10.1 2016-09-22
484
+
485
+
486
+ ### Fixed
487
+
488
+ - Remove obsolete require of `dry/struct` which is now an optional extension (flash-gordon)
489
+
490
+
491
+ [Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-validation/compare/v0.10.0...v0.10.1)
492
+
493
+ ## 0.10.0 2016-09-21
494
+
495
+
496
+ ### Added
497
+
498
+ - Support for `validate` DSL which accepts an arbitratry validation block that gets executed in the context of a schema object and is treated as a custom predicate (solnic)
499
+ - Support for `or` error messages ie "must be a string or must be an integer" (solnic)
500
+ - Support for retrieving error messages exclusively via `schema.(input).errors` (solnic)
501
+ - Support for retrieving hint messages exclusively via `schema.(input).hints` (solnic)
502
+ - Support for opt-in extensions loaded via `Dry::Validation.load_extensions(:my_ext)` (flash-gordon)
503
+ - Add `:monads` extension which transforms a result instance to `Either` monad, `schema.(input).to_either` (flash-gordon)
504
+ - Add `dry-struct` integration via an extension activated by `Dry::Validation.load_extensions(:struct)` (flash-gordon)
505
+
506
+ ### Fixed
507
+
508
+ - Input rules (defined via `input` macro) are now lazy-initialized which makes it work with predicates defined on the schema object (solnic)
509
+ - Hints are properly generated based on argument type in cases like `size?`, where the message should be different for strings (uses "length") or other types (uses "size") (solnic)
510
+ - Defining nested keys without `schema` blocks results in `ArgumentError` (solnic)
511
+
512
+ ### Changed
513
+
514
+ - [BREAKING] `when` macro no longer supports multiple disconnected rules in its block, whatever the block returns will be used for the implication (solnic)
515
+ - [BREAKING] `rule(some_name: %i(some keys))` will _always_ use `:some_name` as the key for failure messages (solnic)
516
+
517
+ [Compare v0.9.5...v0.10.0](https://github.com/dry-rb/dry-validation/compare/v0.9.5...v0.10.0)
518
+
519
+ ## 0.9.5 2016-08-16
520
+
521
+
522
+ ### Fixed
523
+
524
+ - Infering multiple predicates with options works as expected ie `value(:str?, min_size?: 3, max_size?: 6)` (solnic)
525
+ - Default `locale` configured in `I18n` is now respected by the messages compiler (agustin + cavi21)
526
+
527
+
528
+ [Compare v0.9.4...v0.9.5](https://github.com/dry-rb/dry-validation/compare/v0.9.4...v0.9.5)
529
+
530
+ ## 0.9.4 2016-08-11
531
+
532
+
533
+ ### Fixed
534
+
535
+ - Error messages for sibling deeply nested schemas are nested correctly (timriley)
536
+
537
+
538
+ [Compare v0.9.3...v0.9.4](https://github.com/dry-rb/dry-validation/compare/v0.9.3...v0.9.4)
539
+
540
+ ## 0.9.3 2016-07-22
541
+
542
+
543
+ ### Added
544
+
545
+ - Support for range arg in error messages for `excluded_from?` and `included_in?` (mrbongiolo)
546
+ - `Result#message_set` returns raw message set object (solnic)
547
+
548
+ ### Fixed
549
+
550
+ - Error messages for high-level rules in nested schemas are nested correctly (solnic)
551
+ - Dumping error messages works with high-level rules relying on the same value (solnic)
552
+
553
+ ### Changed
554
+
555
+ - `#messages` is no longer memoized (solnic)
556
+
557
+ [Compare v0.9.2...v0.9.3](https://github.com/dry-rb/dry-validation/compare/v0.9.2...v0.9.3)
558
+
559
+ ## 0.9.2 2016-07-13
560
+
561
+
562
+ ### Fixed
563
+
564
+ - Constrained types now work with `each` macro (solnic)
565
+ - Array coercion without member type works now ie `required(:arr).maybe(:array?)` (solnic)
566
+
567
+
568
+ [Compare v0.9.1...v0.9.2](https://github.com/dry-rb/dry-validation/compare/v0.9.1...v0.9.2)
569
+
570
+ ## 0.9.1 2016-07-11
571
+
572
+
573
+ ### Fixed
574
+
575
+ - `I18n` backend is no longer required and set by default (solnic)
576
+
577
+
578
+ [Compare v0.9.0...v0.9.1](https://github.com/dry-rb/dry-validation/compare/v0.9.0...v0.9.1)
579
+
580
+ ## 0.9.0 2016-07-08
581
+
582
+
583
+ ### Added
584
+
585
+ - Support for defining maybe-schemas via `maybe { schema { .. } }` (solnic)
586
+ - Support for interpolation of custom failure messages for custom rules (solnic)
587
+ - Support for defining a base schema **class** with config and rules (solnic)
588
+ - Support for more than 1 predicate in `input` macro (solnic)
589
+ - Class-level `define!` API for defining rules on a class (solnic)
590
+ - `:i18n` messages support merging from other paths via `messages_file` setting (solnic)
591
+ - Support for message token transformations in custom predicates (fran-worley)
592
+ - [EXPERIMENTAL] Ability to compose predicates that accept dynamic args provided by the schema (solnic)
593
+
594
+ ### Fixed
595
+
596
+ - Duped key names in nested schemas no longer result in invalid error messages structure (solnic)
597
+ - Error message structure for deeply nested each/schema rules (solnic)
598
+ - Values from `option` are passed down to nested schemas when using `Schema#with` (solnic)
599
+ - Hints now work with array elements too (solnic)
600
+ - Hints for elements are no longer provided for an array when the value is not an array (solnic)
601
+ - `input` macro no longer messes up error messages for nested structures (solnic)
602
+
603
+ ### Changed
604
+
605
+ - Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
606
+
607
+ [Compare v0.8.0...v0.9.0](https://github.com/dry-rb/dry-validation/compare/v0.8.0...v0.9.0)
608
+
609
+ ## 0.8.0 2016-07-01
610
+
611
+
612
+ ### Added
613
+
614
+ - Explicit interface for type specs used to set up coercions, ie `required(:age, :int)` (solnic)
615
+ - Support new dry-logic predicates: `:excluded_from?`, `:excludes?`, `:included_in?`, `:includes?`, `:not_eql?`, `:odd?`, `:even?` (jodosha, fran-worley)
616
+ - Support for blocks in `value`, `filled` and `maybe` macros (solnic)
617
+ - Support for passing a schema to `value|filled|maybe` macros ie `maybe(SomeSchema)` (solnic)
618
+ - Support for `each(SomeSchema)` (solnic)
619
+ - Support for `value|filled|maybe` macros + `each` inside a block ie: `maybe(:filled?) { each(:int?) }` (solnic)
620
+ - Support for dedicated hint messages via `en.errors.#{predicate}.(hint|failure)` look-up paths (solnic)
621
+ - Support for configuring custom DSL extensions via `dsl_extensions` setting on Schema class (solnic)
622
+ - Support for preconfiguring a predicate for the input value ie `value :hash?` used for prerequisite-checks (solnic)
623
+ - Infer coercion from constrained types (solnic)
624
+ - Add value macro (coop)
625
+ - Enable .schema to accept objects that respond to #schema (ttdonovan)
626
+ - Support for schema predicates which don't need any arguments (fran-worley)
627
+ - Error and hint messages have access to all predicate arguments by default (fran-worley+solnic)
628
+ - Invalid predicate name in DSL will raise an error (solnic)
629
+ - Predicate with invalid arity in DSL will raise an error (solnic)
630
+
631
+ ### Fixed
632
+
633
+ - Support for jRuby 9.1.1.0 (flash-gordon)
634
+ - Fix bug when using predicates with options in each and when (fran-worley)
635
+ - Fix bug when validating custom types (coop)
636
+ - Fix depending on deeply nested values in high-lvl rules (solnic)
637
+ - Fix duplicated error message for lt? when hint was used (solnic)
638
+ - Fix hints for nested schemas (solnic)
639
+ - Fix an issue where rules with same names inside nested schemas have incorrect hints (solnic)
640
+ - Fix a bug where hints were being generated 4 times (solnic)
641
+ - Fix duplicated error messages when message is different than a hint (solnic)
642
+
643
+ ### Changed
644
+
645
+ - Uses new `:weak` hash constructor from dry-types 0.8.0 which can partially coerce invalid hash (solnic)
646
+ - `key` has been deprecated in favor of `required` (coop)
647
+ - `required` has been deprecated in favor of `filled` (coop)
648
+ - Now relies on dry-logic v0.3.0 and dry-types v0.8.0 (fran-worley)
649
+ - Tring to use illogical predicates with maybe and filled macros now raise InvalidSchemaError (fran-worley)
650
+ - Enable coercion on form.true and form.false (fran-worley)
651
+ - Remove attr (will be extracted to a separate gem) (coop)
652
+ - Deprecate required in favour of filled (coop)
653
+ - Deprecate key in favor of required (coop)
654
+ - Remove nested key syntax (solnic)
655
+
656
+ [Compare v0.7.4...v0.8.0](https://github.com/dry-rb/dry-validation/compare/v0.7.4...v0.8.0)
657
+
658
+ ## 0.7.4 2016-04-06
659
+
660
+
661
+ ### Added
662
+
663
+ - `Schema.JSON` with json-specific coercions (coop)
664
+ - Support for error messages for `odd? and`even?` predicates (fran-worley)
665
+
666
+ ### Fixed
667
+
668
+ - Depending on deeply nested values in high-level rules works now (solnic)
669
+
670
+
671
+ [Compare v0.7.3...v0.7.4](https://github.com/dry-rb/dry-validation/compare/v0.7.3...v0.7.4)
672
+
673
+ ## 0.7.3 2016-03-30
674
+
675
+
676
+ ### Added
677
+
678
+ - Support for inferring rules from constrained type (coop + solnic)
679
+ - Support for inferring nested schemas from `Dry::Types::Struct` classes (coop)
680
+ - Support for `number?` predicate (solnic)
681
+
682
+ ### Fixed
683
+
684
+ - Creating a nested schema properly sets full path to nested data structure (solnic)
685
+ - Error message for `empty?` predicate is now correct (jodosha)
686
+
687
+
688
+ [Compare v0.7.2...v0.7.3](https://github.com/dry-rb/dry-validation/compare/v0.7.2...v0.7.3)
689
+
690
+ ## 0.7.2 2016-03-28
691
+
692
+
693
+ ### Added
694
+
695
+ - Support for nested schemas inside high-level rules (solnic)
696
+ - `Schema#to_proc` so that you can do `data.each(&schema)` (solnic)
697
+
698
+
699
+ [Compare v0.7.1...v0.7.2](https://github.com/dry-rb/dry-validation/compare/v0.7.1...v0.7.2)
700
+
701
+ ## 0.7.1 2016-03-21
702
+
703
+
704
+ ### Added
705
+
706
+ - You can use `schema` inside `each` macro (solnic)
707
+
708
+ ### Fixed
709
+
710
+ - `confirmation` macro defines an optional key with maybe value with `_confirmation` suffix (solnic)
711
+ - `each` macro works correctly when its inner rule specify just one key (solnic)
712
+ - error messages for `each` rules where input is equal are now correctly generated (solnic)
713
+
714
+ ### Changed
715
+
716
+ - Now depends on `dry-logic` >= `0.2.1` (solnic)
717
+
718
+ [Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-validation/compare/v0.7.0...v0.7.1)
719
+
720
+ ## 0.7.0 2016-03-16
721
+
722
+
723
+ ### Added
724
+
725
+ - Support for macros:
726
+ - `required` - when value must be filled
727
+ - `maybe` - when value can be nil (or empty, in case of `Form`)
728
+ - `when` - for composing high-level rule based on predicates applied to a
729
+ validated value
730
+ - `confirmation` - for confirmation validation
731
+ - Support for `value(:foo).eql?(value(:bar))` syntax in high-level rules (solnic)
732
+ - New DSL for defining schema objects `Dry::Validation.Schema do .. end` (solnic)
733
+ - Ability to define a schema for an array via top-level `each` rule (solnic)
734
+ - Ability to define nested schemas via `key(:location).schema do .. end` (solnic)
735
+ - Ability to re-use schemas inside other schemas via `key(:location).schema(LocationSchema)` (solnic)
736
+ - Ability to inherit rules from another schema via `Dry::Validation.Schema(Other) do .. end` (solnic)
737
+ - Ability to inject arbitrary dependencies to schemas via `Schema.option` + `Schema#with` (solnic)
738
+ - Ability to provide translations for rule names under `%{locale}.rules.%{name}` pattern (solnic)
739
+ - Ability to configure input processor, either `:form` or `:sanitizer` (solnic)
740
+ - Ability to pass a constrained dry type when defining keys or attrs, ie `key(:age, Types::Age)` (solnic)
741
+ - `Result#messages` supports `:full` option to get messages with rule names, disabled by default (solnic)
742
+ - `Validation::Result` responds to `#[]` and `#each` (delegating to its output)
743
+ and it's an enumerable (solnic)
744
+
745
+ ### Fixed
746
+
747
+ - Qualified rule names properly use last node by default for error messages (solnic)
748
+ - Validation hints only include relevant messages (solnic)
749
+ - `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
750
+
751
+ ### Changed
752
+
753
+ - `schema` was **removed** from the DSL, just use `key(:name).schema` instead (solnic)
754
+ - `confirmation` is now a macro that you can call on a key rule (solnic)
755
+ - rule names for nested structures are now fully qualified, which means you can
756
+ provide customized messages for them. ie `user: :email` (solnic)
757
+ - `Schema::Result#params` was renamed to `#output` (solnic)
758
+ - `Schema::Result` is now `Validation::Result` and it no longer has success and
759
+ failure results, only error results are provided (solnic)
760
+
761
+ [Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-validation/compare/v0.6.0...v0.7.0)
762
+
763
+ ## 0.6.0 2016-01-20
764
+
765
+
766
+ ### Added
767
+
768
+ - Support for validating objects with attr readers via `attr` (SunnyMagadan)
769
+ - Support for `value` interface in the DSL for composing high-level rules based on values (solnic)
770
+ - Support for `rule(name: :something)` syntax for grouping high-level rules under
771
+ the same name (solnic)
772
+ - Support for `confirmation(:foo, some_predicate: some_argument)` shortcut syntax (solnic)
773
+ - Support for error messages for grouped rules (like `confirmation`) (solnic)
774
+ - Schemas support injecting rules from the outside (solnic)
775
+ - ## Changed
776
+ - `rule` uses objects that inherit from `BasicObject` to avoid conflicts with
777
+ predicate names and built-in `Object` methods (solnic)
778
+ - In `Schema::Form` both `key` and `optional` will apply `filled?` predicate by
779
+ default when no block is passed (solnic)
780
+
781
+
782
+ [Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-validation/compare/v0.5.0...v0.6.0)
783
+
784
+ ## 0.5.0 2016-01-11
785
+
786
+
787
+ ### Fixed
788
+
789
+ - `Schema::Form` uses safe `form.array` and `form.hash` types which fixes #42 (solnic)
790
+
791
+ ### Changed
792
+
793
+ - Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
794
+ - `dry/validation/schema/form` is now required by default (solnic)
795
+
796
+ [Compare v0.4.1...v0.5.0](https://github.com/dry-rb/dry-validation/compare/v0.4.1...v0.5.0)
797
+
798
+ ## 0.4.1 2015-12-27
799
+
800
+
801
+ ### Added
802
+
803
+ - Support for `each` and type coercion inference in `Schema::Form` (solnic)
804
+
805
+
806
+ [Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-validation/compare/v0.4.0...v0.4.1)
807
+
808
+ ## 0.4.0 2015-12-21
809
+
810
+
811
+ ### Added
812
+
813
+ - Support for high-level rule composition via `rule` interface (solnic)
814
+ - Support for exclusive disjunction (aka xor/^ operator) (solnic)
815
+ - Support for nested schemas within a schema class (solnic)
816
+ - Support for negating rules via `rule(name).not` (solnic)
817
+ - Support for `validation hints` that are included in the error messages (solnic)
818
+
819
+ ### Fixed
820
+
821
+ - Error messages hash has now consistent structure `rule_name => [msgs_array, input_value]` (solnic)
822
+
823
+
824
+ [Compare v0.3.1...v0.4.0](https://github.com/dry-rb/dry-validation/compare/v0.3.1...v0.4.0)
825
+
826
+ ## 0.3.1 2015-12-08
827
+
828
+
829
+ ### Added
830
+
831
+ - Support for `Range` and `Array` as an argument in `size?` predicate (solnic)
832
+
833
+ ### Fixed
834
+
835
+ - Error compiler returns an empty hash rather than a nil when there are no errors (solnic)
836
+
837
+
838
+ [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-validation/compare/v0.3.0...v0.3.1)
839
+
840
+ ## 0.3.0 2015-12-07
841
+
842
+
843
+ ### Added
844
+
845
+ - I18n messages support (solnic)
846
+ - Ability to configure `messages` via `configure { config.messages = :i18n }` (solnic)
847
+ - `rule` interface in DSL for defining rules that depend on other rules (solnic)
848
+ - `confirmation` interface as a shortcut for defining "confirmation of" rule (solnic)
849
+ - Error messages can be now matched by input value type too (solnic)
850
+
851
+ ### Fixed
852
+
853
+ - `optional` rule with coercions work correctly with `|` + multiple `&`s (solnic)
854
+ - `Schema#[]` checks registered predicates first before defaulting to its own predicates (solnic)
855
+
856
+ ### Changed
857
+
858
+ - `Schema#messages(input)` => `Schema#call(input).messages` (solnic)
859
+ - `Schema#call` returns `Schema::Result` which has access to all rule results,
860
+ errors and messages
861
+ - `Schema::Result#messages` returns a hash with rule names, messages and input values (solnic)
862
+
863
+ [Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-validation/compare/v0.2.0...v0.3.0)
864
+
865
+ ## 0.2.0 2015-11-30
866
+
867
+
868
+ ### Added
869
+
870
+ - `Schema::Form` with a built-in coercer inferred from type-check predicates (solnic)
871
+ - Ability to pass a block to predicate check in the DSL ie `value.hash? { ... }` (solnic)
872
+ - Optional keys using `optional(:key_name) { ... }` interface in the DSL (solnic)
873
+ - New predicates:
874
+ - `bool?`
875
+ - `date?`
876
+ - `date_time?`
877
+ - `time?`
878
+ - `float?`
879
+ - `decimal?`
880
+ - `hash?`
881
+ - `array?`
882
+
883
+ ### Fixed
884
+
885
+ - Added missing `and` / `or` interfaces to composite rules (solnic)
886
+
887
+
888
+ [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-validation/compare/v0.1.0...v0.2.0)
889
+
890
+ ## 0.1.0 2015-11-25
891
+
892
+ First public release