schemacop 2.3.2 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +190 -2
- data/RUBY_VERSION +1 -1
- data/Rakefile +6 -5
- data/VERSION +1 -1
- data/doc/Schemacop.html +30 -3
- data/doc/Schemacop/ArrayValidator.html +2 -2
- data/doc/Schemacop/BooleanValidator.html +1 -1
- data/doc/Schemacop/Caster.html +379 -0
- data/doc/Schemacop/Collector.html +178 -102
- data/doc/Schemacop/Exceptions.html +1 -1
- data/doc/Schemacop/Exceptions/InvalidSchemaError.html +1 -1
- data/doc/Schemacop/Exceptions/ValidationError.html +1 -1
- data/doc/Schemacop/FieldNode.html +17 -5
- data/doc/Schemacop/FloatValidator.html +1 -1
- data/doc/Schemacop/HashValidator.html +1 -1
- data/doc/Schemacop/IntegerValidator.html +1 -1
- data/doc/Schemacop/NilValidator.html +1 -1
- data/doc/Schemacop/Node.html +95 -83
- data/doc/Schemacop/NodeResolver.html +26 -10
- data/doc/Schemacop/NodeSupportingField.html +1 -1
- data/doc/Schemacop/NodeSupportingType.html +2 -4
- data/doc/Schemacop/NodeWithBlock.html +1 -1
- data/doc/Schemacop/NumberValidator.html +1 -1
- data/doc/Schemacop/ObjectValidator.html +1 -1
- data/doc/Schemacop/RootNode.html +1 -1
- data/doc/Schemacop/Schema.html +3 -3
- data/doc/Schemacop/StringValidator.html +1 -1
- data/doc/Schemacop/SymbolValidator.html +1 -1
- data/doc/ScopedEnv.html +1 -1
- data/doc/_index.html +8 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +184 -3
- data/doc/index.html +184 -3
- data/doc/method_list.html +93 -61
- data/doc/top-level-namespace.html +1 -1
- data/lib/schemacop.rb +14 -0
- data/lib/schemacop/caster.rb +38 -0
- data/lib/schemacop/collector.rb +34 -6
- data/lib/schemacop/field_node.rb +25 -3
- data/lib/schemacop/node.rb +10 -2
- data/lib/schemacop/node_resolver.rb +10 -2
- data/lib/schemacop/node_supporting_type.rb +21 -1
- data/lib/schemacop/schema.rb +2 -2
- data/lib/schemacop/validator/array_validator.rb +1 -1
- data/lib/schemacop/validator/float_validator.rb +1 -1
- data/lib/schemacop/validator/integer_validator.rb +1 -1
- data/schemacop.gemspec +14 -8
- data/test/casting_test.rb +90 -0
- data/test/custom_check_test.rb +14 -14
- 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 +73 -66
- 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 +18 -18
- data/test/validator_string_test.rb +12 -12
- data/test/validator_symbol_test.rb +2 -2
- metadata +42 -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: 2019-
|
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
|
@@ -80,6 +94,20 @@ dependencies:
|
|
80
94
|
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: colorize
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: yard
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,19 +151,19 @@ dependencies:
|
|
123
151
|
- !ruby/object:Gem::Version
|
124
152
|
version: '0'
|
125
153
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
154
|
+
name: pry
|
127
155
|
requirement: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
157
|
- - ">="
|
130
158
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
132
|
-
type: :
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
133
161
|
prerelease: false
|
134
162
|
version_requirements: !ruby/object:Gem::Requirement
|
135
163
|
requirements:
|
136
164
|
- - ">="
|
137
165
|
- !ruby/object:Gem::Version
|
138
|
-
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,10 +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
|
220
251
|
- test/collector_test.rb
|
221
252
|
- test/custom_check_test.rb
|
222
253
|
- test/custom_if_test.rb
|
254
|
+
- test/defaults_test.rb
|
223
255
|
- test/nil_dis_allow_test.rb
|
256
|
+
- test/node_resolver_test.rb
|
224
257
|
- test/short_forms_test.rb
|
225
258
|
- test/test_helper.rb
|
226
259
|
- test/types_test.rb
|
@@ -259,10 +292,13 @@ 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
|
262
296
|
- test/collector_test.rb
|
263
297
|
- test/custom_check_test.rb
|
264
298
|
- test/custom_if_test.rb
|
299
|
+
- test/defaults_test.rb
|
265
300
|
- test/nil_dis_allow_test.rb
|
301
|
+
- test/node_resolver_test.rb
|
266
302
|
- test/short_forms_test.rb
|
267
303
|
- test/test_helper.rb
|
268
304
|
- test/types_test.rb
|