dry-schema 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45a3441f7099ddd2ea6c0af6345f1fdcff20cf0629953dfc1eedcce5f8f54995
4
- data.tar.gz: 841584478740cfc72a653e50445b9e3a16c01a6ce49b2c8c8375da76811ca50d
3
+ metadata.gz: c56536db764858bb0d594688d581e4f38fd46f949f75829c20a63d67902f3704
4
+ data.tar.gz: f99af785ccdee69c8cc5d4398b4802612c2b3456e4d472a25d591d593ac9d2bb
5
5
  SHA512:
6
- metadata.gz: 368b80c79f2598dd4cf215c8223dbd704b75909857acf9fa51e60abed19ba3bdc2904ce5d7227ef7259b45593017131ce6ab5434ee3d713fe6b97eed643eecd8
7
- data.tar.gz: 4f5ac8469feb749ed6ca95c022f99b822204d1b1cdde05969795571cabd43cd573111c86cfb4322413a22b5e99958156ba061a598c381989510ecf700fbfc7f0
6
+ metadata.gz: d6f538d54f0ab58595f14e94340e1cb2a3da45a5a4909e8aa5e3bb1a6d68fcd5992debf4d6a8c7909fb25166c11160d970dfb06ac4266e87869117ca984574b1
7
+ data.tar.gz: 3a26179c03e7f4fccce53ae19c6d9133af913407ba64d05bf28a1b173fbdc5e922176edf94c48842829c5b52eda16f5589aa1b98b2848b3094e3713fc2844716
@@ -1,3 +1,15 @@
1
+ ## 1.5.1 2020-05-21
2
+
3
+
4
+ ### Fixed
5
+
6
+ - Negated predicates support the logic operator API now (fixed via #276 by @solnic)
7
+ - Fixed circular require warning (issue #279 closed via #282 by @landongrindheim)
8
+ - Validating keys against an array with non-hash members no longer crashes (issue #283 fixed via #284 by @beechnut and issue #289 fixed via #288 by @tadeusz-niemiec)
9
+
10
+
11
+ [Compare v1.5.0...v1.5.1](https://github.com/dry-rb/dry-schema/compare/v1.5.0...v1.5.1)
12
+
1
13
  ## 1.5.0 2020-03-11
2
14
 
3
15
 
@@ -30,7 +30,7 @@ module Dry
30
30
  # used as nested schemas
31
31
  #
32
32
  # @param [Array] node
33
- # @param [Hash] opts
33
+ # @param [Hash] _opts Unused
34
34
  #
35
35
  # @return [NamespacedRule]
36
36
  #
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "dry/initializer"
4
4
 
5
- require "dry/schema"
6
5
  require "dry/schema/constants"
7
6
  require "dry/schema/path"
8
7
  require "dry/schema/config"
@@ -53,7 +53,8 @@ module Dry
53
53
  when Hash
54
54
  [key].product(key_paths(hash[key])).map { |keys| keys.join(DOT) }
55
55
  when Array
56
- value.flat_map.with_index { |el, idx|
56
+ hashes_or_arrays = value.select { |e| e.is_a?(Array) || e.is_a?(Hash) }
57
+ hashes_or_arrays.flat_map.with_index { |el, idx|
57
58
  key_paths(el).map { |path| ["#{key}[#{idx}]", *path].join(DOT) }
58
59
  }
59
60
  else
@@ -13,6 +13,8 @@ module Dry
13
13
  #
14
14
  # @api private
15
15
  class Negation
16
+ include Dry::Logic::Operators
17
+
16
18
  # @api private
17
19
  attr_reader :predicate
18
20
 
@@ -43,7 +43,7 @@ module Dry
43
43
 
44
44
  # Return a new result scoped to a specific path
45
45
  #
46
- # @param [Symbol, Array, Path]
46
+ # @param path [Symbol, Array, Path]
47
47
  #
48
48
  # @return [Result]
49
49
  #
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "dry/initializer"
4
4
 
5
- require "dry/schema"
6
5
  require "dry/schema/constants"
7
6
  require "dry/schema/config"
8
7
  require "dry/schema/result"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Schema
5
- VERSION = "1.5.0"
5
+ VERSION = "1.5.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.5.0
4
+ version: 1.5.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: 2020-03-11 00:00:00.000000000 Z
11
+ date: 2020-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby