nakischema 0.1.2 → 0.1.3
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 +2 -1
- data/nakischema.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f12dd71c0e349bb4c32d404317b64e8f4bfe2d4c
|
4
|
+
data.tar.gz: 56ade8e30f239f41d315b6aefa2bef82e434a605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b32ad0bd582d777c3a8cf03878b359d95278e0690625a4c6184bf26fff4050e60e972539270799a6927f6dc609d18c3edd63cbf92653b01f4f2f387dff973951
|
7
|
+
data.tar.gz: a014ed22afe9721d23b70eefe0a012188d001db8f8fe179be2c9b0d5557a3e3aa15d5d813ebe78e603cefeb72787c5efb9baf1b17dfc2bd916d6cf7d8c4c95c4
|
data/lib/nakischema.rb
CHANGED
@@ -85,6 +85,7 @@ module Nakischema
|
|
85
85
|
raise Error.new "#{msg}#{" (at #{_path})" unless _path.empty?}"
|
86
86
|
end
|
87
87
|
case schema
|
88
|
+
when String, Regexp ; raise_with_path.call "expected #{schema.inspect} != #{object.inspect}" unless schema === object
|
88
89
|
when Hash
|
89
90
|
schema.each do |k, v|
|
90
91
|
case k
|
@@ -100,7 +101,7 @@ module Nakischema
|
|
100
101
|
validate_oga_xml selected, v, [*path, k]
|
101
102
|
end
|
102
103
|
when :children ; v.each{ |k, v| validate_oga_xml object.xpath(k.start_with?("./") ? k : "./#{k}"), v, [*path, k] }
|
103
|
-
when :attr_req ; v.each{ |k, v|
|
104
|
+
when :attr_req ; v.each{ |k, v| validate_oga_xml object[k], v, [*path, k] }
|
104
105
|
when :assertions
|
105
106
|
v.each_with_index do |assertion, i|
|
106
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.3"
|
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
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nakischema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Maslov aka Nakilon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The most compact yet powerful arbitrary nested objects validator. Especially
|
14
14
|
handy to validate JSONs.
|