aliquot 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aliquot/validator.rb +7 -8
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e752bf7cf311e4fe611e3c868ed08510c54d9e1b05b327d5dfa390b3eeb8cee7
|
4
|
+
data.tar.gz: 5c7df397cabccc5009c712546838c67329f4e2c835935ba56e62f71b6c368920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 648c2bb459b2a09b602c13dab8c8221fc726c886e047789c84ebf51d1436a3f5fece61255905744cf817dcf114d9833f3f0281d5c7ed18a6eb1c44a60b770521
|
7
|
+
data.tar.gz: eb060ab6212f664bf3545a306dee4eaac7f63a6388921faf70cc28393e7bc606731d408edb3224ce737c3bc9ef8be8efa16942df717e157a1f3e0f746ad467f6
|
data/lib/aliquot/validator.rb
CHANGED
@@ -226,7 +226,7 @@ module Aliquot
|
|
226
226
|
@validation ||= @schema.call(@input)
|
227
227
|
@output = @validation.to_h
|
228
228
|
return true if @validation.success?
|
229
|
-
raise Aliquot::ValidationError, "validation error(s)
|
229
|
+
raise Aliquot::ValidationError, "validation error(s): #{error_list.join(', ')}"
|
230
230
|
end
|
231
231
|
|
232
232
|
def valid?
|
@@ -241,13 +241,12 @@ module Aliquot
|
|
241
241
|
@validation.errors
|
242
242
|
end
|
243
243
|
|
244
|
-
def
|
245
|
-
node.
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
end
|
244
|
+
def error_list(node = errors.to_h, path = '')
|
245
|
+
if node.is_a?(Array)
|
246
|
+
node.map { |error| "#{path} #{error}" }
|
247
|
+
elsif node.is_a?(Hash)
|
248
|
+
path = "#{path}." unless path.empty?
|
249
|
+
node.flat_map { |key, sub_node| error_list(sub_node, "#{path}#{key}") }
|
251
250
|
end
|
252
251
|
end
|
253
252
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aliquot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clearhaus
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-validation
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.14.1
|
97
|
-
description:
|
97
|
+
description:
|
98
98
|
email: hello@clearhaus.com
|
99
99
|
executables: []
|
100
100
|
extensions: []
|
@@ -108,7 +108,7 @@ homepage: https://github.com/clearhaus/aliquot
|
|
108
108
|
licenses:
|
109
109
|
- MIT
|
110
110
|
metadata: {}
|
111
|
-
post_install_message:
|
111
|
+
post_install_message:
|
112
112
|
rdoc_options: []
|
113
113
|
require_paths:
|
114
114
|
- lib
|
@@ -123,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.3.
|
127
|
-
signing_key:
|
126
|
+
rubygems_version: 3.3.5
|
127
|
+
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Validates Google Pay tokens
|
130
130
|
test_files: []
|