schemacop 2.1.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +58 -0
- data/LICENSE +1 -1
- data/README.md +250 -16
- data/RUBY_VERSION +1 -1
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/doc/Schemacop.html +32 -5
- data/doc/Schemacop/ArrayValidator.html +4 -4
- data/doc/Schemacop/BooleanValidator.html +4 -4
- data/doc/Schemacop/Caster.html +379 -0
- data/doc/Schemacop/Collector.html +298 -46
- data/doc/Schemacop/Exceptions.html +3 -3
- data/doc/Schemacop/Exceptions/InvalidSchemaError.html +3 -3
- data/doc/Schemacop/Exceptions/ValidationError.html +3 -3
- data/doc/Schemacop/FieldNode.html +19 -7
- data/doc/Schemacop/FloatValidator.html +4 -4
- data/doc/Schemacop/HashValidator.html +33 -7
- data/doc/Schemacop/IntegerValidator.html +4 -4
- data/doc/Schemacop/NilValidator.html +4 -4
- data/doc/Schemacop/Node.html +97 -85
- data/doc/Schemacop/NodeResolver.html +28 -12
- data/doc/Schemacop/NodeSupportingField.html +4 -4
- data/doc/Schemacop/NodeSupportingType.html +5 -7
- data/doc/Schemacop/NodeWithBlock.html +4 -4
- data/doc/Schemacop/NumberValidator.html +4 -4
- data/doc/Schemacop/ObjectValidator.html +20 -10
- data/doc/Schemacop/RootNode.html +4 -4
- data/doc/Schemacop/Schema.html +6 -6
- data/doc/Schemacop/StringValidator.html +3 -3
- data/doc/Schemacop/SymbolValidator.html +4 -4
- data/doc/ScopedEnv.html +3 -3
- data/doc/_index.html +11 -4
- data/doc/class_list.html +1 -1
- data/doc/css/style.css +10 -6
- data/doc/file.README.html +255 -29
- data/doc/frames.html +1 -1
- data/doc/index.html +255 -29
- data/doc/js/app.js +55 -0
- data/doc/method_list.html +99 -51
- data/doc/top-level-namespace.html +3 -3
- data/lib/schemacop.rb +15 -0
- data/lib/schemacop/caster.rb +38 -0
- data/lib/schemacop/collector.rb +53 -6
- data/lib/schemacop/field_node.rb +25 -3
- data/lib/schemacop/node.rb +16 -4
- data/lib/schemacop/node_resolver.rb +10 -2
- data/lib/schemacop/node_supporting_field.rb +0 -2
- data/lib/schemacop/node_supporting_type.rb +21 -1
- data/lib/schemacop/schema.rb +3 -3
- data/lib/schemacop/validator/array_validator.rb +1 -1
- data/lib/schemacop/validator/float_validator.rb +1 -1
- data/lib/schemacop/validator/hash_validator.rb +15 -2
- data/lib/schemacop/validator/integer_validator.rb +1 -1
- data/lib/schemacop/validator/object_validator.rb +7 -1
- data/schemacop.gemspec +15 -9
- data/test/casting_test.rb +90 -0
- data/test/collector_test.rb +45 -0
- data/test/custom_check_test.rb +20 -13
- data/test/custom_if_test.rb +12 -12
- data/test/defaults_test.rb +71 -0
- data/test/nil_dis_allow_test.rb +6 -6
- data/test/node_resolver_test.rb +26 -0
- data/test/short_forms_test.rb +86 -64
- data/test/test_helper.rb +7 -0
- data/test/types_test.rb +5 -5
- data/test/validator_array_test.rb +16 -16
- data/test/validator_boolean_test.rb +2 -2
- data/test/validator_float_test.rb +15 -15
- data/test/validator_hash_test.rb +5 -5
- data/test/validator_integer_test.rb +9 -9
- data/test/validator_nil_test.rb +1 -1
- data/test/validator_number_test.rb +19 -19
- data/test/validator_object_test.rb +33 -15
- data/test/validator_string_test.rb +12 -12
- data/test/validator_symbol_test.rb +2 -2
- metadata +43 -6
@@ -7,8 +7,8 @@ module Schemacop
|
|
7
7
|
type :symbol
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
assert_nothing_raised { s.validate!(:good) }
|
11
|
+
assert_nothing_raised { s.validate!('-+/'.to_sym) }
|
12
12
|
assert_verr { s.validate!('bad') }
|
13
13
|
assert_verr { s.validate!(456) }
|
14
14
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schemacop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sitrox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +81,7 @@ dependencies:
|
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: haml
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - ">="
|
@@ -81,7 +95,7 @@ dependencies:
|
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: colorize
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - ">="
|
@@ -136,6 +150,20 @@ dependencies:
|
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
139
167
|
description:
|
140
168
|
email:
|
141
169
|
executables: []
|
@@ -157,6 +185,7 @@ files:
|
|
157
185
|
- doc/Schemacop.html
|
158
186
|
- doc/Schemacop/ArrayValidator.html
|
159
187
|
- doc/Schemacop/BooleanValidator.html
|
188
|
+
- doc/Schemacop/Caster.html
|
160
189
|
- doc/Schemacop/Collector.html
|
161
190
|
- doc/Schemacop/Exceptions.html
|
162
191
|
- doc/Schemacop/Exceptions/InvalidSchemaError.html
|
@@ -195,6 +224,7 @@ files:
|
|
195
224
|
- doc/method_list.html
|
196
225
|
- doc/top-level-namespace.html
|
197
226
|
- lib/schemacop.rb
|
227
|
+
- lib/schemacop/caster.rb
|
198
228
|
- lib/schemacop/collector.rb
|
199
229
|
- lib/schemacop/exceptions.rb
|
200
230
|
- lib/schemacop/field_node.rb
|
@@ -217,9 +247,13 @@ files:
|
|
217
247
|
- lib/schemacop/validator/string_validator.rb
|
218
248
|
- lib/schemacop/validator/symbol_validator.rb
|
219
249
|
- schemacop.gemspec
|
250
|
+
- test/casting_test.rb
|
251
|
+
- test/collector_test.rb
|
220
252
|
- test/custom_check_test.rb
|
221
253
|
- test/custom_if_test.rb
|
254
|
+
- test/defaults_test.rb
|
222
255
|
- test/nil_dis_allow_test.rb
|
256
|
+
- test/node_resolver_test.rb
|
223
257
|
- test/short_forms_test.rb
|
224
258
|
- test/test_helper.rb
|
225
259
|
- test/types_test.rb
|
@@ -252,16 +286,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
286
|
- !ruby/object:Gem::Version
|
253
287
|
version: '0'
|
254
288
|
requirements: []
|
255
|
-
|
256
|
-
rubygems_version: 2.6.8
|
289
|
+
rubygems_version: 3.0.3
|
257
290
|
signing_key:
|
258
291
|
specification_version: 4
|
259
292
|
summary: Schemacop validates ruby structures consisting of nested hashes and arrays
|
260
293
|
against simple schema definitions.
|
261
294
|
test_files:
|
295
|
+
- test/casting_test.rb
|
296
|
+
- test/collector_test.rb
|
262
297
|
- test/custom_check_test.rb
|
263
298
|
- test/custom_if_test.rb
|
299
|
+
- test/defaults_test.rb
|
264
300
|
- test/nil_dis_allow_test.rb
|
301
|
+
- test/node_resolver_test.rb
|
265
302
|
- test/short_forms_test.rb
|
266
303
|
- test/test_helper.rb
|
267
304
|
- test/types_test.rb
|