schemacop 2.3.2 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +190 -2
  4. data/RUBY_VERSION +1 -1
  5. data/Rakefile +6 -5
  6. data/VERSION +1 -1
  7. data/doc/Schemacop.html +30 -3
  8. data/doc/Schemacop/ArrayValidator.html +2 -2
  9. data/doc/Schemacop/BooleanValidator.html +1 -1
  10. data/doc/Schemacop/Caster.html +379 -0
  11. data/doc/Schemacop/Collector.html +178 -102
  12. data/doc/Schemacop/Exceptions.html +1 -1
  13. data/doc/Schemacop/Exceptions/InvalidSchemaError.html +1 -1
  14. data/doc/Schemacop/Exceptions/ValidationError.html +1 -1
  15. data/doc/Schemacop/FieldNode.html +17 -5
  16. data/doc/Schemacop/FloatValidator.html +1 -1
  17. data/doc/Schemacop/HashValidator.html +1 -1
  18. data/doc/Schemacop/IntegerValidator.html +1 -1
  19. data/doc/Schemacop/NilValidator.html +1 -1
  20. data/doc/Schemacop/Node.html +95 -83
  21. data/doc/Schemacop/NodeResolver.html +26 -10
  22. data/doc/Schemacop/NodeSupportingField.html +1 -1
  23. data/doc/Schemacop/NodeSupportingType.html +2 -4
  24. data/doc/Schemacop/NodeWithBlock.html +1 -1
  25. data/doc/Schemacop/NumberValidator.html +1 -1
  26. data/doc/Schemacop/ObjectValidator.html +1 -1
  27. data/doc/Schemacop/RootNode.html +1 -1
  28. data/doc/Schemacop/Schema.html +3 -3
  29. data/doc/Schemacop/StringValidator.html +1 -1
  30. data/doc/Schemacop/SymbolValidator.html +1 -1
  31. data/doc/ScopedEnv.html +1 -1
  32. data/doc/_index.html +8 -1
  33. data/doc/class_list.html +1 -1
  34. data/doc/file.README.html +184 -3
  35. data/doc/index.html +184 -3
  36. data/doc/method_list.html +93 -61
  37. data/doc/top-level-namespace.html +1 -1
  38. data/lib/schemacop.rb +14 -0
  39. data/lib/schemacop/caster.rb +38 -0
  40. data/lib/schemacop/collector.rb +34 -6
  41. data/lib/schemacop/field_node.rb +25 -3
  42. data/lib/schemacop/node.rb +10 -2
  43. data/lib/schemacop/node_resolver.rb +10 -2
  44. data/lib/schemacop/node_supporting_type.rb +21 -1
  45. data/lib/schemacop/schema.rb +2 -2
  46. data/lib/schemacop/validator/array_validator.rb +1 -1
  47. data/lib/schemacop/validator/float_validator.rb +1 -1
  48. data/lib/schemacop/validator/integer_validator.rb +1 -1
  49. data/schemacop.gemspec +14 -8
  50. data/test/casting_test.rb +90 -0
  51. data/test/custom_check_test.rb +14 -14
  52. data/test/custom_if_test.rb +12 -12
  53. data/test/defaults_test.rb +71 -0
  54. data/test/nil_dis_allow_test.rb +6 -6
  55. data/test/node_resolver_test.rb +26 -0
  56. data/test/short_forms_test.rb +73 -66
  57. data/test/test_helper.rb +7 -0
  58. data/test/types_test.rb +5 -5
  59. data/test/validator_array_test.rb +16 -16
  60. data/test/validator_boolean_test.rb +2 -2
  61. data/test/validator_float_test.rb +15 -15
  62. data/test/validator_hash_test.rb +5 -5
  63. data/test/validator_integer_test.rb +9 -9
  64. data/test/validator_nil_test.rb +1 -1
  65. data/test/validator_number_test.rb +19 -19
  66. data/test/validator_object_test.rb +18 -18
  67. data/test/validator_string_test.rb +12 -12
  68. data/test/validator_symbol_test.rb +2 -2
  69. metadata +42 -6
@@ -7,8 +7,8 @@ module Schemacop
7
7
  type :symbol
8
8
  end
9
9
 
10
- assert_nil s.validate!(:good)
11
- assert_nil s.validate!('-+/'.to_sym)
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.3.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-09-26 00:00:00.000000000 Z
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: activesupport
154
+ name: pry
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - ">="
130
158
  - !ruby/object:Gem::Version
131
- version: '4.0'
132
- type: :runtime
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: '4.0'
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