dry-schema 1.6.0 → 1.6.1

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: 286fc26d17ad546acf8370b4fdba754c85f495a0d6dd8da0c4ce564066c30859
4
- data.tar.gz: b6f080291da562eca2e1e4407e9fc079062b45a12c7d24739137b5e7502be429
3
+ metadata.gz: '07179bd67f80d0a500d2484a2169f09804612a38ce9601819203d89bc0d109a1'
4
+ data.tar.gz: 1337a9d5197257e3bc773f87af7785e4297624b3d10699ea5b9c977be4a19a67
5
5
  SHA512:
6
- metadata.gz: 340ac4d40469019131a1bc3ff0284b95ee7d83b151b013cc91ded5eb1629cc35ab535ac7e3c8a3dc70033e955ec91629df8ed18b89b44f9cacb50c4c1231f283
7
- data.tar.gz: 4847c4e9ee2d9fa28051d6ec0a160415505e3f7475c95ef550cca927ed9b59f78da4be4333064a9e750a395cb497e09d36f9e70e44333e46850506f6365ba82e
6
+ metadata.gz: 10b8ea1df48c45fa50bcc35be0d7e9785c90285fb29bdc0ad712745803280f9de53ea80643dccefd923df263ba20973cd2b4956dd2d773701ff4ad9050ab3742
7
+ data.tar.gz: 42776d375539ec537361f2c6e95c027020107e6f92bd14a866ed1b37e10af5ae0037eb0866278aa8877ce62f617222201b34f58db3e43925ae89f46585359a9a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 1.6.1 2021-02-02
4
+
5
+
6
+ ### Fixed
7
+
8
+ - Messages#[] handles meta/no meta cases more gracefully and has better interoperability with the I18n backend. This brings MessageCompiler#visit_unexpected_key up to parity with MessageCompiler#visit_predicate. Uses visit_predicate as basis for visit_unexpected_key. (@robhanlon22)
9
+
10
+
11
+ [Compare v1.6.0...v1.6.1](https://github.com/dry-rb/dry-schema/compare/v1.6.0...v1.6.1)
12
+
3
13
  ## 1.6.0 2021-01-21
4
14
 
5
15
 
@@ -4,8 +4,9 @@ require "dry/initializer"
4
4
 
5
5
  require "dry/schema/constants"
6
6
  require "dry/schema/message"
7
- require "dry/schema/message_set"
8
7
  require "dry/schema/message_compiler/visitor_opts"
8
+ require "dry/schema/message_set"
9
+ require "dry/schema/path"
9
10
 
10
11
  module Dry
11
12
  module Schema
@@ -109,18 +110,8 @@ module Dry
109
110
  end
110
111
 
111
112
  # @api private
112
- def visit_unexpected_key(node, _opts)
113
- path, input = node
114
-
115
- msg = messages.translate("errors.unexpected_key")
116
-
117
- Message.new(
118
- path: path,
119
- meta: msg[:meta] || EMPTY_HASH,
120
- text: msg[:text],
121
- predicate: nil,
122
- input: input
123
- )
113
+ def visit_unexpected_key(node, opts)
114
+ visit_predicate([:unexpected_key, []], opts.dup.update(path: Path[node.first]))
124
115
  end
125
116
 
126
117
  # @api private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Schema
5
- VERSION = "1.6.0"
5
+ VERSION = "1.6.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-21 00:00:00.000000000 Z
11
+ date: 2021-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby