nakischema 0.2.2 → 0.2.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6b78ac714d96363a641affd005c7ba1b2c316591b83d95f5d02f0caccc1761b
|
4
|
+
data.tar.gz: 2780c15868fc68411189254543426b01714a76431b3d42960c02750a7ff99c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8524b72b2f0d9d29e79e0c1c1f66b87f01105d421e4e959198d850388ad2fa9ceec24ff0cf819ed35891b46b27f7bbdee3f77c263baeae67fa7ed909418e1438
|
7
|
+
data.tar.gz: 339416a5c8e5bacef02ae4d83124fffff7f7bc46a12d1bd1981b1c42246058b6f6f76ad08820ebd64b11cd39d809014d47e9ce4a6a828f719a07f1bbd06a683e
|
data/lib/nakischema.rb
CHANGED
@@ -11,7 +11,7 @@ module Nakischema
|
|
11
11
|
# TODO: maybe deprecate the NilClass, TrueClass, FalseClass since they can be asserted via the next case branch
|
12
12
|
when Class ; raise_with_path.call "expected #{schema } != #{object.class }" unless schema === object
|
13
13
|
when Regexp ; raise_with_path.call "expected #{schema } != #{object.inspect}" unless schema === object
|
14
|
-
when Range ; raise_with_path.call "expected #{schema } != #{object
|
14
|
+
when Range ; raise_with_path.call "expected #{schema } != #{object.inspect}" unless schema.include? object
|
15
15
|
when Hash
|
16
16
|
raise_with_path.call "expected Hash != #{object.class}" unless object.is_a? Hash unless (schema.keys & %i{ keys each_key each_value }).empty?
|
17
17
|
raise_with_path.call "expected Array != #{object.class}" unless object.is_a? Array unless (schema.keys & %i{ size }).empty? # TODO: maybe allow Hash object?
|
@@ -166,6 +166,7 @@ module Nakischema
|
|
166
166
|
when Class
|
167
167
|
case _.name
|
168
168
|
when "Integer" ; -rand(1000000)
|
169
|
+
when "String" ; SecureRandom.random_bytes(1000).force_encoding("utf-8").scrub
|
169
170
|
when "Hash" ; {}
|
170
171
|
else ; fail "bad fixture node class name: #{_.name}"
|
171
172
|
end
|
data/nakischema.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "nakischema"
|
3
|
-
spec.version = "0.2.
|
3
|
+
spec.version = "0.2.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.2.
|
4
|
+
version: 0.2.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: 2023-
|
11
|
+
date: 2023-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: regexp-examples
|