respect 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +289 -0
  3. data/RELATED_WORK.md +40 -0
  4. data/RELEASE_NOTES.md +23 -0
  5. data/Rakefile +31 -0
  6. data/STATUS_MATRIX.html +137 -0
  7. data/lib/respect.rb +231 -0
  8. data/lib/respect/any_schema.rb +22 -0
  9. data/lib/respect/array_def.rb +28 -0
  10. data/lib/respect/array_schema.rb +203 -0
  11. data/lib/respect/boolean_schema.rb +32 -0
  12. data/lib/respect/composite_schema.rb +86 -0
  13. data/lib/respect/core_statements.rb +206 -0
  14. data/lib/respect/datetime_schema.rb +27 -0
  15. data/lib/respect/def_without_name.rb +6 -0
  16. data/lib/respect/divisible_by_validator.rb +20 -0
  17. data/lib/respect/doc_helper.rb +24 -0
  18. data/lib/respect/doc_parser.rb +37 -0
  19. data/lib/respect/dsl_dumper.rb +181 -0
  20. data/lib/respect/equal_to_validator.rb +20 -0
  21. data/lib/respect/fake_name_proxy.rb +116 -0
  22. data/lib/respect/float_schema.rb +27 -0
  23. data/lib/respect/format_validator.rb +136 -0
  24. data/lib/respect/global_def.rb +79 -0
  25. data/lib/respect/greater_than_or_equal_to_validator.rb +19 -0
  26. data/lib/respect/greater_than_validator.rb +19 -0
  27. data/lib/respect/has_constraints.rb +34 -0
  28. data/lib/respect/hash_def.rb +40 -0
  29. data/lib/respect/hash_schema.rb +218 -0
  30. data/lib/respect/in_validator.rb +19 -0
  31. data/lib/respect/integer_schema.rb +27 -0
  32. data/lib/respect/ip_addr_schema.rb +23 -0
  33. data/lib/respect/ipv4_addr_schema.rb +27 -0
  34. data/lib/respect/ipv6_addr_schema.rb +27 -0
  35. data/lib/respect/items_def.rb +21 -0
  36. data/lib/respect/json_schema_html_formatter.rb +143 -0
  37. data/lib/respect/less_than_or_equal_to_validator.rb +19 -0
  38. data/lib/respect/less_than_validator.rb +19 -0
  39. data/lib/respect/match_validator.rb +19 -0
  40. data/lib/respect/max_length_validator.rb +20 -0
  41. data/lib/respect/min_length_validator.rb +20 -0
  42. data/lib/respect/multiple_of_validator.rb +10 -0
  43. data/lib/respect/null_schema.rb +26 -0
  44. data/lib/respect/numeric_schema.rb +33 -0
  45. data/lib/respect/org3_dumper.rb +213 -0
  46. data/lib/respect/regexp_schema.rb +19 -0
  47. data/lib/respect/schema.rb +285 -0
  48. data/lib/respect/schema_def.rb +16 -0
  49. data/lib/respect/string_schema.rb +21 -0
  50. data/lib/respect/unit_test_helper.rb +37 -0
  51. data/lib/respect/uri_schema.rb +23 -0
  52. data/lib/respect/utc_time_schema.rb +17 -0
  53. data/lib/respect/validator.rb +51 -0
  54. data/lib/respect/version.rb +3 -0
  55. data/test/any_schema_test.rb +79 -0
  56. data/test/array_def_test.rb +113 -0
  57. data/test/array_schema_test.rb +487 -0
  58. data/test/boolean_schema_test.rb +89 -0
  59. data/test/composite_schema_test.rb +30 -0
  60. data/test/datetime_schema_test.rb +83 -0
  61. data/test/doc_helper_test.rb +34 -0
  62. data/test/doc_parser_test.rb +109 -0
  63. data/test/dsl_dumper_test.rb +395 -0
  64. data/test/fake_name_proxy_test.rb +138 -0
  65. data/test/float_schema_test.rb +146 -0
  66. data/test/format_validator_test.rb +224 -0
  67. data/test/hash_def_test.rb +126 -0
  68. data/test/hash_schema_test.rb +613 -0
  69. data/test/integer_schema_test.rb +142 -0
  70. data/test/ip_addr_schema_test.rb +78 -0
  71. data/test/ipv4_addr_schema_test.rb +71 -0
  72. data/test/ipv6_addr_schema_test.rb +71 -0
  73. data/test/json_schema_html_formatter_test.rb +214 -0
  74. data/test/null_schema_test.rb +46 -0
  75. data/test/numeric_schema_test.rb +294 -0
  76. data/test/org3_dumper_test.rb +784 -0
  77. data/test/regexp_schema_test.rb +54 -0
  78. data/test/respect_test.rb +108 -0
  79. data/test/schema_def_test.rb +405 -0
  80. data/test/schema_test.rb +290 -0
  81. data/test/string_schema_test.rb +209 -0
  82. data/test/support/circle.rb +11 -0
  83. data/test/support/color.rb +24 -0
  84. data/test/support/point.rb +11 -0
  85. data/test/support/respect/circle_schema.rb +16 -0
  86. data/test/support/respect/color_def.rb +19 -0
  87. data/test/support/respect/color_schema.rb +33 -0
  88. data/test/support/respect/point_schema.rb +19 -0
  89. data/test/support/respect/rgba_schema.rb +20 -0
  90. data/test/support/respect/universal_validator.rb +25 -0
  91. data/test/support/respect/user_macros.rb +12 -0
  92. data/test/support/rgba.rb +11 -0
  93. data/test/test_helper.rb +90 -0
  94. data/test/uri_schema_test.rb +54 -0
  95. data/test/utc_time_schema_test.rb +63 -0
  96. data/test/validator_test.rb +22 -0
  97. metadata +288 -0
metadata ADDED
@@ -0,0 +1,288 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: respect
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Nicolas Despres
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.13
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.13
30
+ - !ruby/object:Gem::Dependency
31
+ name: yard
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.8.5.2
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.5.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: mocha
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.13.3
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.13.3
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 10.0.4
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 10.0.4
78
+ - !ruby/object:Gem::Dependency
79
+ name: redcarpet
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.2.2
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.2.2
94
+ - !ruby/object:Gem::Dependency
95
+ name: debugger
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.3.3
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.3.3
110
+ description: Respect let you specify object schema using a Ruby DSL. It also provides
111
+ validators, sanitizers and dumpers to generate json-schema.org compliant spec. It
112
+ is perfect to specify JSON document structure.
113
+ email:
114
+ - nicolas.despres@gmail.com
115
+ executables: []
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - lib/respect/any_schema.rb
120
+ - lib/respect/array_def.rb
121
+ - lib/respect/array_schema.rb
122
+ - lib/respect/boolean_schema.rb
123
+ - lib/respect/composite_schema.rb
124
+ - lib/respect/core_statements.rb
125
+ - lib/respect/datetime_schema.rb
126
+ - lib/respect/def_without_name.rb
127
+ - lib/respect/divisible_by_validator.rb
128
+ - lib/respect/doc_helper.rb
129
+ - lib/respect/doc_parser.rb
130
+ - lib/respect/dsl_dumper.rb
131
+ - lib/respect/equal_to_validator.rb
132
+ - lib/respect/fake_name_proxy.rb
133
+ - lib/respect/float_schema.rb
134
+ - lib/respect/format_validator.rb
135
+ - lib/respect/global_def.rb
136
+ - lib/respect/greater_than_or_equal_to_validator.rb
137
+ - lib/respect/greater_than_validator.rb
138
+ - lib/respect/has_constraints.rb
139
+ - lib/respect/hash_def.rb
140
+ - lib/respect/hash_schema.rb
141
+ - lib/respect/in_validator.rb
142
+ - lib/respect/integer_schema.rb
143
+ - lib/respect/ip_addr_schema.rb
144
+ - lib/respect/ipv4_addr_schema.rb
145
+ - lib/respect/ipv6_addr_schema.rb
146
+ - lib/respect/items_def.rb
147
+ - lib/respect/json_schema_html_formatter.rb
148
+ - lib/respect/less_than_or_equal_to_validator.rb
149
+ - lib/respect/less_than_validator.rb
150
+ - lib/respect/match_validator.rb
151
+ - lib/respect/max_length_validator.rb
152
+ - lib/respect/min_length_validator.rb
153
+ - lib/respect/multiple_of_validator.rb
154
+ - lib/respect/null_schema.rb
155
+ - lib/respect/numeric_schema.rb
156
+ - lib/respect/org3_dumper.rb
157
+ - lib/respect/regexp_schema.rb
158
+ - lib/respect/schema.rb
159
+ - lib/respect/schema_def.rb
160
+ - lib/respect/string_schema.rb
161
+ - lib/respect/unit_test_helper.rb
162
+ - lib/respect/uri_schema.rb
163
+ - lib/respect/utc_time_schema.rb
164
+ - lib/respect/validator.rb
165
+ - lib/respect/version.rb
166
+ - lib/respect.rb
167
+ - MIT-LICENSE
168
+ - Rakefile
169
+ - README.md
170
+ - STATUS_MATRIX.html
171
+ - RELEASE_NOTES.md
172
+ - RELATED_WORK.md
173
+ - test/any_schema_test.rb
174
+ - test/array_def_test.rb
175
+ - test/array_schema_test.rb
176
+ - test/boolean_schema_test.rb
177
+ - test/composite_schema_test.rb
178
+ - test/datetime_schema_test.rb
179
+ - test/doc_helper_test.rb
180
+ - test/doc_parser_test.rb
181
+ - test/dsl_dumper_test.rb
182
+ - test/fake_name_proxy_test.rb
183
+ - test/float_schema_test.rb
184
+ - test/format_validator_test.rb
185
+ - test/hash_def_test.rb
186
+ - test/hash_schema_test.rb
187
+ - test/integer_schema_test.rb
188
+ - test/ip_addr_schema_test.rb
189
+ - test/ipv4_addr_schema_test.rb
190
+ - test/ipv6_addr_schema_test.rb
191
+ - test/json_schema_html_formatter_test.rb
192
+ - test/null_schema_test.rb
193
+ - test/numeric_schema_test.rb
194
+ - test/org3_dumper_test.rb
195
+ - test/regexp_schema_test.rb
196
+ - test/respect_test.rb
197
+ - test/schema_def_test.rb
198
+ - test/schema_test.rb
199
+ - test/string_schema_test.rb
200
+ - test/support/circle.rb
201
+ - test/support/color.rb
202
+ - test/support/point.rb
203
+ - test/support/respect/circle_schema.rb
204
+ - test/support/respect/color_def.rb
205
+ - test/support/respect/color_schema.rb
206
+ - test/support/respect/point_schema.rb
207
+ - test/support/respect/rgba_schema.rb
208
+ - test/support/respect/universal_validator.rb
209
+ - test/support/respect/user_macros.rb
210
+ - test/support/rgba.rb
211
+ - test/test_helper.rb
212
+ - test/uri_schema_test.rb
213
+ - test/utc_time_schema_test.rb
214
+ - test/validator_test.rb
215
+ homepage: http://nicolasdespres.github.io/respect
216
+ licenses: []
217
+ post_install_message:
218
+ rdoc_options: []
219
+ require_paths:
220
+ - lib
221
+ required_ruby_version: !ruby/object:Gem::Requirement
222
+ none: false
223
+ requirements:
224
+ - - ! '>='
225
+ - !ruby/object:Gem::Version
226
+ version: '0'
227
+ segments:
228
+ - 0
229
+ hash: 1688974886618784159
230
+ required_rubygems_version: !ruby/object:Gem::Requirement
231
+ none: false
232
+ requirements:
233
+ - - ! '>='
234
+ - !ruby/object:Gem::Version
235
+ version: '0'
236
+ segments:
237
+ - 0
238
+ hash: 1688974886618784159
239
+ requirements: []
240
+ rubyforge_project:
241
+ rubygems_version: 1.8.23
242
+ signing_key:
243
+ specification_version: 3
244
+ summary: Object schema definition using a Ruby DSL.
245
+ test_files:
246
+ - test/any_schema_test.rb
247
+ - test/array_def_test.rb
248
+ - test/array_schema_test.rb
249
+ - test/boolean_schema_test.rb
250
+ - test/composite_schema_test.rb
251
+ - test/datetime_schema_test.rb
252
+ - test/doc_helper_test.rb
253
+ - test/doc_parser_test.rb
254
+ - test/dsl_dumper_test.rb
255
+ - test/fake_name_proxy_test.rb
256
+ - test/float_schema_test.rb
257
+ - test/format_validator_test.rb
258
+ - test/hash_def_test.rb
259
+ - test/hash_schema_test.rb
260
+ - test/integer_schema_test.rb
261
+ - test/ip_addr_schema_test.rb
262
+ - test/ipv4_addr_schema_test.rb
263
+ - test/ipv6_addr_schema_test.rb
264
+ - test/json_schema_html_formatter_test.rb
265
+ - test/null_schema_test.rb
266
+ - test/numeric_schema_test.rb
267
+ - test/org3_dumper_test.rb
268
+ - test/regexp_schema_test.rb
269
+ - test/respect_test.rb
270
+ - test/schema_def_test.rb
271
+ - test/schema_test.rb
272
+ - test/string_schema_test.rb
273
+ - test/support/circle.rb
274
+ - test/support/color.rb
275
+ - test/support/point.rb
276
+ - test/support/respect/circle_schema.rb
277
+ - test/support/respect/color_def.rb
278
+ - test/support/respect/color_schema.rb
279
+ - test/support/respect/point_schema.rb
280
+ - test/support/respect/rgba_schema.rb
281
+ - test/support/respect/universal_validator.rb
282
+ - test/support/respect/user_macros.rb
283
+ - test/support/rgba.rb
284
+ - test/test_helper.rb
285
+ - test/uri_schema_test.rb
286
+ - test/utc_time_schema_test.rb
287
+ - test/validator_test.rb
288
+ has_rdoc: