data-validator 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/data/validator/version.rb +1 -1
- data/lib/data/validator.rb +2 -2
- data/test/gfx/{008_optional.t → 008_optional.rb} +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c0b111d5ff665740d694bc24cc0b880764592b3
|
4
|
+
data.tar.gz: 37224d4295b3f968e58b52874656b465e75dbf81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 040be98b8146b289a6cf59f490e0d6bd949f02c2f6a9fe439a849d728f1a08590d26f795cf94ea54990973f9b098f03cfe9694a743edb5ffb59975d4f4eb284b
|
7
|
+
data.tar.gz: e7fb62c23cef4b75597befdbb5895e8e285e2ef130a21b0866a5d755be6bf78779fe49df876b948248ebc68e6178cd000d4df3582900a943ea47cae7b7d02548
|
data/lib/data/validator.rb
CHANGED
@@ -85,7 +85,7 @@ class Data::Validator
|
|
85
85
|
when @isa == Hash then
|
86
86
|
recur = rule[:rule].each_pair.each_with_object Hash.new do |(k, v), r|
|
87
87
|
case v when Hash then
|
88
|
-
r[k] = self.class.send :bare_new, v
|
88
|
+
r[k] = self.class.send :bare_new, **v
|
89
89
|
else
|
90
90
|
r[k] = self.class.send :bare_new, isa: v
|
91
91
|
end
|
@@ -229,4 +229,4 @@ class Data::Validator
|
|
229
229
|
end
|
230
230
|
|
231
231
|
require_relative 'validator/recursive'
|
232
|
-
require_relative 'validator/
|
232
|
+
require_relative 'validator/error'
|
@@ -7,9 +7,9 @@ class Test008Optional < Test::Unit::TestCase
|
|
7
7
|
v = Data::Validator.new(
|
8
8
|
'foo' => { },
|
9
9
|
'bar' => { },
|
10
|
-
'baz' => { optional
|
10
|
+
'baz' => { optional: 1 }
|
11
11
|
)
|
12
|
-
|
12
|
+
assert { v.is_a? Data::Validator }
|
13
13
|
|
14
14
|
args = v.validate({ 'foo' => 1, 'bar' => 2 })
|
15
15
|
assert { args == { 'foo' => 1, 'bar' => 2 } }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data-validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Urabe, Shyouhei
|
@@ -130,7 +130,7 @@ files:
|
|
130
130
|
- test/gfx/002_isa.rb
|
131
131
|
- test/gfx/003_default.rb
|
132
132
|
- test/gfx/004_xor.rb
|
133
|
-
- test/gfx/008_optional.
|
133
|
+
- test/gfx/008_optional.rb
|
134
134
|
- test/gfx/010_common_params.rb
|
135
135
|
- test/gfx/104_extra_args.rb
|
136
136
|
- test/xaicron/00_compile.rb
|
@@ -167,7 +167,7 @@ test_files:
|
|
167
167
|
- test/gfx/002_isa.rb
|
168
168
|
- test/gfx/003_default.rb
|
169
169
|
- test/gfx/004_xor.rb
|
170
|
-
- test/gfx/008_optional.
|
170
|
+
- test/gfx/008_optional.rb
|
171
171
|
- test/gfx/010_common_params.rb
|
172
172
|
- test/gfx/104_extra_args.rb
|
173
173
|
- test/xaicron/00_compile.rb
|