nakischema 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe6edc1f3b95435d8fa18f6d2836086050d96276b1397fce0a378ceafbaf2797
4
- data.tar.gz: 2b23892f25a662c9c788a611cf1417dffcbc65a8bf4ae275cd03bfb220b17337
3
+ metadata.gz: f6b78ac714d96363a641affd005c7ba1b2c316591b83d95f5d02f0caccc1761b
4
+ data.tar.gz: 2780c15868fc68411189254543426b01714a76431b3d42960c02750a7ff99c61
5
5
  SHA512:
6
- metadata.gz: 4e3659f172ace66b3b3353e0630f8be2e4baa5c252fa27f22c9def7e37954082a62ed642d082b1015087e2b3126df54c477caa165179e595a401431d84b801cd
7
- data.tar.gz: ec1de44276cb84f9d2e2ec374ef5be6c62fa7f9655149f572111c62911a2f83c2360450a29724e6b115147c8c467c8a44b4597363bddeb20067c5dd0b27229c7
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 }" unless schema.include? 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.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.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-08-03 00:00:00.000000000 Z
11
+ date: 2023-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: regexp-examples