nakischema 0.1.3 → 0.1.4
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 +4 -4
- data/lib/nakischema.rb +6 -6
- data/nakischema.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 271b63150c8a6eead2fba711f312b2e2f82ba24a
|
|
4
|
+
data.tar.gz: 829b656fc7a75c629d3ccea2ac44ca4de98d4598
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07bd982a7331b8ec0937b97d682b623d4c85ac14bcb71512dc85bc16536f40f8a01dfcac0df379097614f84748a93d2d426c2addb45b0f0ca703ee1b0c069ef6
|
|
7
|
+
data.tar.gz: c2716c3ad3e8e804891ef364c31ca7ffc3a2289b16a32f203905362b866bc3f832932be3a0350c25edd41b60d7d22c3b1739d2e279aebd0f1987d76655e07ee2
|
data/lib/nakischema.rb
CHANGED
|
@@ -96,12 +96,12 @@ module Nakischema
|
|
|
96
96
|
when :exact ; children = object.xpath "./*"
|
|
97
97
|
names = children.map(&:name).uniq
|
|
98
98
|
raise_with_path.call "expected implicit children #{v.keys} != #{names}" unless v.keys == names
|
|
99
|
-
v.each
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
when :attr_req
|
|
99
|
+
v.each{ |k, v| validate_oga_xml children.select{ |_| _.name == k }, v, [*path, k] }
|
|
100
|
+
when :children ; v.each{ |k, v| validate_oga_xml object.xpath(k.start_with?("./") ? k : "./#{k}"), v, [*path, k] }
|
|
101
|
+
when :attr_exact ; names = object.attributes.map &:name
|
|
102
|
+
raise_with_path.call "expected implicit attributes #{v.keys} != #{names}" unless v.keys == names
|
|
103
|
+
v.each{ |k, v| validate_oga_xml object[k], v, [*path, k] }
|
|
104
|
+
when :attr_req ; v.each{ |k, v| validate_oga_xml object[k], v, [*path, k] }
|
|
105
105
|
when :assertions
|
|
106
106
|
v.each_with_index do |assertion, i|
|
|
107
107
|
begin
|
data/nakischema.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |spec|
|
|
2
2
|
spec.name = "nakischema"
|
|
3
|
-
spec.version = "0.1.
|
|
3
|
+
spec.version = "0.1.4"
|
|
4
4
|
spec.summary = "compact yet powerful arbitrary nested objects validator"
|
|
5
5
|
spec.description = "The most compact yet powerful arbitrary nested objects validator. Especially handy to validate JSONs."
|
|
6
6
|
|