kwalify 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. data/CHANGES.txt +232 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.txt +16 -19
  4. data/bin/kwalify +3 -3
  5. data/contrib/inline-require +6 -4
  6. data/contrib/kwalify +3719 -2427
  7. data/doc-api/classes/CommandOptionError.html +17 -17
  8. data/doc-api/classes/CommandOptionParser.html +63 -63
  9. data/doc-api/classes/Kwalify.html +29 -7
  10. data/doc-api/classes/Kwalify/AssertionError.html +9 -9
  11. data/doc-api/classes/Kwalify/BaseError.html +72 -71
  12. data/doc-api/classes/Kwalify/BaseParser.html +461 -0
  13. data/doc-api/classes/Kwalify/CommandOptionError.html +11 -11
  14. data/doc-api/classes/Kwalify/ErrorHelper.html +51 -46
  15. data/doc-api/classes/Kwalify/HashInterface.html +13 -135
  16. data/doc-api/classes/Kwalify/Json.html +105 -0
  17. data/doc-api/classes/Kwalify/Main.html +129 -126
  18. data/doc-api/classes/Kwalify/MetaValidator.html +248 -232
  19. data/doc-api/classes/Kwalify/Parser.html +12 -12
  20. data/doc-api/classes/Kwalify/PlainYamlParser.html +166 -163
  21. data/doc-api/classes/Kwalify/PlainYamlParser/Alias.html +11 -11
  22. data/doc-api/classes/Kwalify/Rule.html +152 -130
  23. data/doc-api/classes/Kwalify/SchemaError.html +10 -10
  24. data/doc-api/classes/Kwalify/SyntaxError.html +185 -0
  25. data/doc-api/classes/Kwalify/Types.html +26 -25
  26. data/doc-api/classes/Kwalify/Util.html +389 -0
  27. data/doc-api/classes/Kwalify/Util/HashLike.html +246 -0
  28. data/doc-api/classes/Kwalify/Util/OrderedHash.html +330 -0
  29. data/doc-api/classes/Kwalify/ValidationError.html +10 -10
  30. data/doc-api/classes/Kwalify/Validator.html +153 -86
  31. data/doc-api/classes/Kwalify/Yaml.html +181 -0
  32. data/doc-api/classes/Kwalify/Yaml/Parser.html +1538 -0
  33. data/doc-api/classes/Kwalify/YamlParser.html +190 -183
  34. data/doc-api/classes/Kwalify/YamlSyntaxError.html +8 -57
  35. data/doc-api/created.rid +1 -1
  36. data/doc-api/files/__/README_txt.html +17 -22
  37. data/doc-api/files/kwalify/errors_rb.html +2 -2
  38. data/doc-api/files/kwalify/main_rb.html +4 -3
  39. data/doc-api/files/kwalify/messages_rb.html +2 -2
  40. data/doc-api/files/kwalify/meta-validator_rb.html +3 -3
  41. data/doc-api/files/kwalify/{util/yaml-helper_rb.html → parser/base_rb.html} +8 -6
  42. data/doc-api/files/kwalify/parser/yaml_rb.html +117 -0
  43. data/doc-api/files/kwalify/rule_rb.html +2 -2
  44. data/doc-api/files/kwalify/types_rb.html +2 -2
  45. data/doc-api/files/kwalify/util/assert-text-equal_rb.html +2 -2
  46. data/doc-api/files/kwalify/util/hash-interface_rb.html +9 -2
  47. data/doc-api/files/kwalify/util/hashlike_rb.html +107 -0
  48. data/doc-api/files/kwalify/util/option-parser_rb.html +2 -2
  49. data/doc-api/files/kwalify/util/ordered-hash_rb.html +107 -0
  50. data/doc-api/files/kwalify/util/testcase-helper_rb.html +2 -2
  51. data/doc-api/files/kwalify/util_rb.html +107 -0
  52. data/doc-api/files/kwalify/validator_rb.html +2 -2
  53. data/doc-api/files/kwalify/yaml-parser_rb.html +2 -2
  54. data/doc-api/files/kwalify_rb.html +3 -2
  55. data/doc-api/fr_class_index.html +8 -1
  56. data/doc-api/fr_file_index.html +5 -1
  57. data/doc-api/fr_method_index.html +128 -69
  58. data/doc/img/fig01.png +0 -0
  59. data/doc/users-guide.html +882 -717
  60. data/examples/address-book/address-book.schema.yaml +2 -2
  61. data/examples/data-binding/BABEL.data.yaml +63 -0
  62. data/examples/data-binding/BABEL.schema.yaml +31 -0
  63. data/examples/data-binding/Makefile +8 -0
  64. data/examples/data-binding/Rakefile +13 -0
  65. data/examples/data-binding/main.rb +27 -0
  66. data/examples/invoice/invoice.schema.yaml +3 -3
  67. data/examples/tapkit/tapkit.schema.yaml +2 -2
  68. data/lib/kwalify.rb +41 -4
  69. data/lib/kwalify/errors.rb +118 -96
  70. data/lib/kwalify/kwalify.schema.yaml +58 -0
  71. data/lib/kwalify/main.rb +384 -377
  72. data/lib/kwalify/messages.rb +41 -27
  73. data/lib/kwalify/meta-validator.rb +251 -331
  74. data/lib/kwalify/parser/base.rb +127 -0
  75. data/lib/kwalify/parser/yaml.rb +837 -0
  76. data/lib/kwalify/rule.rb +545 -487
  77. data/lib/kwalify/templates/genclass-java.eruby +189 -162
  78. data/lib/kwalify/templates/genclass-php.eruby +104 -0
  79. data/lib/kwalify/templates/genclass-ruby.eruby +95 -66
  80. data/lib/kwalify/types.rb +107 -106
  81. data/lib/kwalify/util.rb +157 -0
  82. data/lib/kwalify/util/assert-text-equal.rb +33 -31
  83. data/lib/kwalify/util/hash-interface.rb +11 -30
  84. data/lib/kwalify/util/hashlike.rb +51 -0
  85. data/lib/kwalify/util/option-parser.rb +144 -144
  86. data/lib/kwalify/util/ordered-hash.rb +57 -0
  87. data/lib/kwalify/util/testcase-helper.rb +3 -3
  88. data/lib/kwalify/validator.rb +267 -212
  89. data/lib/kwalify/yaml-parser.rb +822 -768
  90. data/setup.rb +861 -607
  91. data/test/Rookbook.yaml +10 -0
  92. data/test/{tmp.dir/Context.java → data/users-guide/AddressBook.java.expected} +11 -11
  93. data/test/data/users-guide/BABEL.data.yaml +24 -0
  94. data/test/data/users-guide/BABEL.schema.yaml +30 -0
  95. data/test/data/users-guide/ExampleAddressBook.java +47 -0
  96. data/test/{tmp.dir/Group.java → data/users-guide/Group.java.expected} +2 -11
  97. data/test/data/users-guide/Person.java.expected +44 -0
  98. data/test/data/users-guide/address_book.rb +52 -0
  99. data/test/data/users-guide/address_book.schema.yaml +28 -0
  100. data/test/data/users-guide/address_book.yaml +27 -0
  101. data/test/data/users-guide/answers-schema.yaml +12 -0
  102. data/test/data/users-guide/answers-validator.rb +52 -0
  103. data/test/data/users-guide/babel_genclass.result +26 -0
  104. data/test/data/users-guide/config.schema.yaml +7 -0
  105. data/test/data/users-guide/config.yaml +4 -0
  106. data/test/{tmp.dir/silent1.document → data/users-guide/document01a.yaml} +0 -0
  107. data/test/data/users-guide/document01b.yaml +3 -0
  108. data/test/data/users-guide/document02a.yaml +4 -0
  109. data/test/data/users-guide/document02b.yaml +4 -0
  110. data/test/data/users-guide/document03a.yaml +6 -0
  111. data/test/data/users-guide/document03b.yaml +6 -0
  112. data/test/data/users-guide/document04a.yaml +9 -0
  113. data/test/data/users-guide/document04b.yaml +9 -0
  114. data/test/data/users-guide/document05a.yaml +11 -0
  115. data/test/data/users-guide/document05b.yaml +12 -0
  116. data/test/data/users-guide/document06a.yaml +15 -0
  117. data/test/data/users-guide/document06b.yaml +16 -0
  118. data/test/data/users-guide/document07a.yaml +9 -0
  119. data/test/data/users-guide/document07b.yaml +7 -0
  120. data/test/data/users-guide/document12a.json +10 -0
  121. data/test/data/users-guide/document12b.json +6 -0
  122. data/test/data/users-guide/document13a.yaml +17 -0
  123. data/test/data/users-guide/document14a.yaml +3 -0
  124. data/test/data/users-guide/document14b.yaml +3 -0
  125. data/test/data/users-guide/document15a.yaml +6 -0
  126. data/test/data/users-guide/document15b.yaml +5 -0
  127. data/test/data/users-guide/example_address_book.rb +10 -0
  128. data/test/data/users-guide/example_address_book_java.result +32 -0
  129. data/test/data/users-guide/example_address_book_ruby.result +31 -0
  130. data/test/data/users-guide/genclass_java.result +4 -0
  131. data/test/data/users-guide/howto-validation-with-parsing.rb +28 -0
  132. data/test/data/users-guide/howto-validation.rb +25 -0
  133. data/test/data/users-guide/howto3.rb +6 -0
  134. data/test/data/users-guide/howto3.result +5 -0
  135. data/test/data/users-guide/howto3.yaml +8 -0
  136. data/test/data/users-guide/howto5_databinding.result +111 -0
  137. data/test/data/users-guide/invalid01.result +3 -0
  138. data/test/data/users-guide/invalid02.result +5 -0
  139. data/test/data/users-guide/invalid03.result +5 -0
  140. data/test/data/users-guide/invalid04.result +4 -0
  141. data/test/data/users-guide/invalid05.result +11 -0
  142. data/test/data/users-guide/invalid06.result +4 -0
  143. data/test/data/users-guide/invalid07.result +3 -0
  144. data/test/data/users-guide/invalid08.result +3 -0
  145. data/test/data/users-guide/invalid12.json +8 -0
  146. data/test/data/users-guide/invalid14.result +4 -0
  147. data/test/data/users-guide/invalid15.result +4 -0
  148. data/test/data/users-guide/loadbabel.rb +27 -0
  149. data/test/data/users-guide/loadconfig.rb +15 -0
  150. data/test/data/users-guide/loadconfig.result +2 -0
  151. data/test/data/users-guide/models.rb +22 -0
  152. data/test/data/users-guide/option_ha.result +6 -0
  153. data/test/data/users-guide/option_ha_genclass_java.result +7 -0
  154. data/test/{tmp.dir/meta1.schema → data/users-guide/schema01.yaml} +0 -0
  155. data/test/data/users-guide/schema02.yaml +12 -0
  156. data/test/data/users-guide/schema03.yaml +9 -0
  157. data/test/data/users-guide/schema04.yaml +20 -0
  158. data/test/data/users-guide/schema05.yaml +29 -0
  159. data/test/data/users-guide/schema06.yaml +11 -0
  160. data/test/data/users-guide/schema12.json +12 -0
  161. data/test/data/users-guide/schema13.yaml +13 -0
  162. data/test/data/users-guide/schema14.yaml +5 -0
  163. data/test/data/users-guide/schema15.yaml +21 -0
  164. data/test/data/users-guide/valid01.result +2 -0
  165. data/test/data/users-guide/valid02.result +2 -0
  166. data/test/data/users-guide/valid03.result +2 -0
  167. data/test/data/users-guide/valid04.result +2 -0
  168. data/test/data/users-guide/valid05.result +2 -0
  169. data/test/data/users-guide/valid06.result +2 -0
  170. data/test/data/users-guide/valid07.result +2 -0
  171. data/test/data/users-guide/valid08.result +2 -0
  172. data/test/data/users-guide/valid12.result +2 -0
  173. data/test/data/users-guide/valid13.result +2 -0
  174. data/test/data/users-guide/valid14.result +2 -0
  175. data/test/data/users-guide/valid15.result +2 -0
  176. data/test/data/users-guide/validate08.rb +37 -0
  177. data/test/test-action.rb +78 -0
  178. data/test/test-action.yaml +738 -0
  179. data/test/test-databinding.rb +80 -0
  180. data/test/test-databinding.yaml +301 -0
  181. data/test/test-main.rb +129 -150
  182. data/test/test-main.yaml +126 -321
  183. data/test/test-metavalidator.rb +47 -47
  184. data/test/test-metavalidator.yaml +77 -21
  185. data/test/test-parser-yaml.rb +57 -0
  186. data/test/test-parser-yaml.yaml +1749 -0
  187. data/test/test-rule.rb +14 -15
  188. data/test/test-rule.yaml +6 -3
  189. data/test/test-users-guide.rb +75 -0
  190. data/test/test-validator.rb +77 -52
  191. data/test/test-validator.yaml +168 -6
  192. data/test/test-yaml-parser.rb +47 -0
  193. data/test/{test-yamlparser.yaml → test-yaml-parser.yaml} +159 -52
  194. data/test/test.rb +37 -21
  195. metadata +136 -37
  196. data/COPYING +0 -340
  197. data/ChangeLog +0 -70
  198. data/doc-api/classes/YamlHelper.html +0 -259
  199. data/lib/kwalify/util/yaml-helper.rb +0 -82
  200. data/test/test-yamlparser.rb +0 -58
  201. data/test/tmp.dir/User.java +0 -43
  202. data/test/tmp.dir/action1.document +0 -18
  203. data/test/tmp.dir/action1.schema +0 -32
  204. data/test/tmp.dir/action2.document +0 -18
  205. data/test/tmp.dir/action2.schema +0 -32
  206. data/test/tmp.dir/emacs.document +0 -6
  207. data/test/tmp.dir/emacs.schema +0 -6
  208. data/test/tmp.dir/meta1.document +0 -0
  209. data/test/tmp.dir/meta2.document +0 -0
  210. data/test/tmp.dir/meta2.schema +0 -3
  211. data/test/tmp.dir/silent1.schema +0 -3
  212. data/test/tmp.dir/silent2.document +0 -7
  213. data/test/tmp.dir/silent2.schema +0 -3
  214. data/test/tmp.dir/stream.invalid +0 -8
  215. data/test/tmp.dir/stream.schema +0 -3
  216. data/test/tmp.dir/stream.valid +0 -8
  217. data/test/tmp.dir/untabify.document +0 -5
  218. data/test/tmp.dir/untabify.schema +0 -10
  219. data/todo.txt +0 -34
@@ -80,7 +80,7 @@
80
80
 
81
81
  <div id="description">
82
82
  <p>
83
- $Rev: 51 $ $Release: 0.6.1 $ copyright(c) 2005 kuwata-lab all rights reserved.
83
+ $Rev: 83 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
84
84
  </p>
85
85
 
86
86
  </div>
@@ -147,23 +147,23 @@ $Rev: 51 $ $Release: 0.6.1 $ copyright(c) 2005 kuwata-lab all rights reserved.
147
147
  <div class="method-source-code" id="M000001-source">
148
148
  <pre>
149
149
  <span class="ruby-comment cmt"># File kwalify/util/option-parser.rb, line 8</span>
150
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">option</span>, <span class="ruby-identifier">error_symbol</span>, <span class="ruby-identifier">message</span>=<span class="ruby-keyword kw">nil</span>)
151
- <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">message</span>
152
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">error_symbol</span>
153
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:no_argument</span>
154
- <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;-%s: argument required.&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">option</span>
155
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:unknown_option</span>
156
- <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;-%s: unknown option.&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">option</span>
157
- <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:invalid_property</span>
158
- <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;-%s: invalid property.&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">option</span>
159
- <span class="ruby-keyword kw">else</span>
160
- <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;*** internal error(optchar=#{option}, error_symbol=#{error_symbol}) ***&quot;</span>
161
- <span class="ruby-keyword kw">end</span>
150
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">option</span>, <span class="ruby-identifier">error_symbol</span>, <span class="ruby-identifier">message</span>=<span class="ruby-keyword kw">nil</span>)
151
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">message</span>
152
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">error_symbol</span>
153
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:no_argument</span>
154
+ <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;-%s: argument required.&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">option</span>
155
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:unknown_option</span>
156
+ <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;-%s: unknown option.&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">option</span>
157
+ <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:invalid_property</span>
158
+ <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;-%s: invalid property.&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">option</span>
159
+ <span class="ruby-keyword kw">else</span>
160
+ <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;*** internal error(optchar=#{option}, error_symbol=#{error_symbol}) ***&quot;</span>
162
161
  <span class="ruby-keyword kw">end</span>
163
- <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
164
- <span class="ruby-ivar">@option</span> = <span class="ruby-identifier">option</span>
165
- <span class="ruby-ivar">@error_symbol</span> = <span class="ruby-identifier">error_symbol</span>
166
- <span class="ruby-keyword kw">end</span>
162
+ <span class="ruby-keyword kw">end</span>
163
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
164
+ <span class="ruby-ivar">@option</span> = <span class="ruby-identifier">option</span>
165
+ <span class="ruby-ivar">@error_symbol</span> = <span class="ruby-identifier">error_symbol</span>
166
+ <span class="ruby-keyword kw">end</span>
167
167
  </pre>
168
168
  </div>
169
169
  </div>
@@ -191,11 +191,11 @@ optionally
191
191
  <div class="method-source-code" id="M000002-source">
192
192
  <pre>
193
193
  <span class="ruby-comment cmt"># File kwalify/util/option-parser.rb, line 92</span>
194
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">arg_none</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg_required</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg_optional</span>=<span class="ruby-keyword kw">nil</span>)
195
- <span class="ruby-ivar">@arg_none</span> = <span class="ruby-identifier">arg_none</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
196
- <span class="ruby-ivar">@arg_required</span> = <span class="ruby-identifier">arg_required</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
197
- <span class="ruby-ivar">@arg_optional</span> = <span class="ruby-identifier">arg_optional</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
198
- <span class="ruby-keyword kw">end</span>
194
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">arg_none</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg_required</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg_optional</span>=<span class="ruby-keyword kw">nil</span>)
195
+ <span class="ruby-ivar">@arg_none</span> = <span class="ruby-identifier">arg_none</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
196
+ <span class="ruby-ivar">@arg_required</span> = <span class="ruby-identifier">arg_required</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
197
+ <span class="ruby-ivar">@arg_optional</span> = <span class="ruby-identifier">arg_optional</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
198
+ <span class="ruby-keyword kw">end</span>
199
199
  </pre>
200
200
  </div>
201
201
  </div>
@@ -216,18 +216,18 @@ optionally
216
216
  <div class="method-source-code" id="M000003-source">
217
217
  <pre>
218
218
  <span class="ruby-comment cmt"># File kwalify/util/option-parser.rb, line 99</span>
219
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_value</span>(<span class="ruby-identifier">str</span>)
220
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">str</span>
221
- <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;null&quot;</span>, <span class="ruby-value str">&quot;nil&quot;</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
222
- <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;true&quot;</span>, <span class="ruby-value str">&quot;yes&quot;</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
223
- <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;false&quot;</span>, <span class="ruby-value str">&quot;no&quot;</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
224
- <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A\d+\z/</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_i</span>
225
- <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A\d+\.\d+\z/</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_f</span>
226
- <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\/(.*)\//</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">$1</span>)
227
- <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A'.*'\z/</span>, <span class="ruby-regexp re">/\A&quot;.*&quot;\z/</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">str</span>)
228
- <span class="ruby-keyword kw">else</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>
229
- <span class="ruby-keyword kw">end</span>
230
- <span class="ruby-keyword kw">end</span>
219
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_value</span>(<span class="ruby-identifier">str</span>)
220
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">str</span>
221
+ <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;null&quot;</span>, <span class="ruby-value str">&quot;nil&quot;</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
222
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;true&quot;</span>, <span class="ruby-value str">&quot;yes&quot;</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
223
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;false&quot;</span>, <span class="ruby-value str">&quot;no&quot;</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
224
+ <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A\d+\z/</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_i</span>
225
+ <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A\d+\.\d+\z/</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_f</span>
226
+ <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\/(.*)\//</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">$1</span>)
227
+ <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/\A'.*'\z/</span>, <span class="ruby-regexp re">/\A&quot;.*&quot;\z/</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">str</span>)
228
+ <span class="ruby-keyword kw">else</span> ; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>
229
+ <span class="ruby-keyword kw">end</span>
230
+ <span class="ruby-keyword kw">end</span>
231
231
  </pre>
232
232
  </div>
233
233
  </div>
@@ -259,52 +259,52 @@ optionally
259
259
  <div class="method-source-code" id="M000004-source">
260
260
  <pre>
261
261
  <span class="ruby-comment cmt"># File kwalify/util/option-parser.rb, line 115</span>
262
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">argv</span>, <span class="ruby-identifier">auto_convert</span>=<span class="ruby-keyword kw">false</span>)
263
- <span class="ruby-identifier">options</span> = {}
264
- <span class="ruby-identifier">properties</span> = {}
265
- <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">argv</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">argv</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?-</span>
266
- <span class="ruby-identifier">optstr</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
267
- <span class="ruby-identifier">optstr</span> = <span class="ruby-identifier">optstr</span>[<span class="ruby-value">1</span>, <span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>]
268
- <span class="ruby-comment cmt">#</span>
269
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">optstr</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?-</span> <span class="ruby-comment cmt">## property</span>
270
- <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">optstr</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A\-([-\w]+)(?:=(.*))?/</span>
271
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">optstr</span>, <span class="ruby-identifier">:invalid_property</span>)
272
- <span class="ruby-keyword kw">end</span>
273
- <span class="ruby-identifier">prop_name</span> = <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">prop_value</span> = <span class="ruby-identifier">$2</span>
274
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">auto_convert</span>
275
- <span class="ruby-identifier">key</span> = <span class="ruby-identifier">prop_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/-/</span>, <span class="ruby-value str">'_'</span>).<span class="ruby-identifier">intern</span>
276
- <span class="ruby-identifier">value</span> = <span class="ruby-identifier">prop_value</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-constant">CommandOptionParser</span>.<span class="ruby-identifier">to_value</span>(<span class="ruby-identifier">prop_value</span>)
277
- <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
278
- <span class="ruby-keyword kw">else</span>
279
- <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">prop_name</span>] = <span class="ruby-identifier">prop_value</span>
280
- <span class="ruby-keyword kw">end</span>
281
- <span class="ruby-comment cmt">#</span>
282
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">## options</span>
283
- <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">optstr</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">empty?</span>
284
- <span class="ruby-identifier">optchar</span> = <span class="ruby-identifier">optstr</span>[<span class="ruby-value">0</span>]
285
- <span class="ruby-identifier">optstr</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] = <span class="ruby-value str">&quot;&quot;</span>
286
- <span class="ruby-comment cmt">#puts &quot;*** debug: optchar=#{optchar.chr}, optstr=#{optstr.inspect}&quot;</span>
287
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@arg_none</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">optchar</span>)
288
- <span class="ruby-identifier">options</span>[<span class="ruby-identifier">optchar</span>] = <span class="ruby-keyword kw">true</span>
289
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@arg_required</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">optchar</span>)
290
- <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">optstr</span>
291
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">optchar</span>.<span class="ruby-identifier">chr</span>, <span class="ruby-identifier">:no_argument</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">arg</span>
292
- <span class="ruby-identifier">options</span>[<span class="ruby-identifier">optchar</span>] = <span class="ruby-identifier">arg</span>
293
- <span class="ruby-identifier">optstr</span> = <span class="ruby-keyword kw">nil</span>
294
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@arg_optional</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">optchar</span>)
295
- <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">optstr</span>
296
- <span class="ruby-identifier">options</span>[<span class="ruby-identifier">optchar</span>] = <span class="ruby-identifier">arg</span>
297
- <span class="ruby-identifier">optstr</span> = <span class="ruby-keyword kw">nil</span>
298
- <span class="ruby-keyword kw">else</span>
299
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">optchar</span>.<span class="ruby-identifier">chr</span>, <span class="ruby-identifier">:unknown_option</span>)
300
- <span class="ruby-keyword kw">end</span>
301
- <span class="ruby-keyword kw">end</span>
302
- <span class="ruby-keyword kw">end</span>
303
- <span class="ruby-comment cmt">#</span>
304
- <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># end of while</span>
305
-
306
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>, <span class="ruby-identifier">properties</span>
307
- <span class="ruby-keyword kw">end</span>
262
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">argv</span>, <span class="ruby-identifier">auto_convert</span>=<span class="ruby-keyword kw">false</span>)
263
+ <span class="ruby-identifier">options</span> = {}
264
+ <span class="ruby-identifier">properties</span> = {}
265
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">argv</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">argv</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?-</span>
266
+ <span class="ruby-identifier">optstr</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
267
+ <span class="ruby-identifier">optstr</span> = <span class="ruby-identifier">optstr</span>[<span class="ruby-value">1</span>, <span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>]
268
+ <span class="ruby-comment cmt">#</span>
269
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">optstr</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?-</span> <span class="ruby-comment cmt">## property</span>
270
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">optstr</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A\-([-\w]+)(?:=(.*))?/</span>
271
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">optstr</span>, <span class="ruby-identifier">:invalid_property</span>)
272
+ <span class="ruby-keyword kw">end</span>
273
+ <span class="ruby-identifier">prop_name</span> = <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">prop_value</span> = <span class="ruby-identifier">$2</span>
274
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">auto_convert</span>
275
+ <span class="ruby-identifier">key</span> = <span class="ruby-identifier">prop_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/-/</span>, <span class="ruby-value str">'_'</span>).<span class="ruby-identifier">intern</span>
276
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">prop_value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-constant">CommandOptionParser</span>.<span class="ruby-identifier">to_value</span>(<span class="ruby-identifier">prop_value</span>)
277
+ <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
278
+ <span class="ruby-keyword kw">else</span>
279
+ <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">prop_name</span>] = <span class="ruby-identifier">prop_value</span>
280
+ <span class="ruby-keyword kw">end</span>
281
+ <span class="ruby-comment cmt">#</span>
282
+ <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">## options</span>
283
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">optstr</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">empty?</span>
284
+ <span class="ruby-identifier">optchar</span> = <span class="ruby-identifier">optstr</span>[<span class="ruby-value">0</span>]
285
+ <span class="ruby-identifier">optstr</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] = <span class="ruby-value str">&quot;&quot;</span>
286
+ <span class="ruby-comment cmt">#puts &quot;*** debug: optchar=#{optchar.chr}, optstr=#{optstr.inspect}&quot;</span>
287
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@arg_none</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">optchar</span>)
288
+ <span class="ruby-identifier">options</span>[<span class="ruby-identifier">optchar</span>] = <span class="ruby-keyword kw">true</span>
289
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@arg_required</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">optchar</span>)
290
+ <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">optstr</span>
291
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">optchar</span>.<span class="ruby-identifier">chr</span>, <span class="ruby-identifier">:no_argument</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">arg</span>
292
+ <span class="ruby-identifier">options</span>[<span class="ruby-identifier">optchar</span>] = <span class="ruby-identifier">arg</span>
293
+ <span class="ruby-identifier">optstr</span> = <span class="ruby-keyword kw">nil</span>
294
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@arg_optional</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">optchar</span>)
295
+ <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">optstr</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">optstr</span>
296
+ <span class="ruby-identifier">options</span>[<span class="ruby-identifier">optchar</span>] = <span class="ruby-identifier">arg</span>
297
+ <span class="ruby-identifier">optstr</span> = <span class="ruby-keyword kw">nil</span>
298
+ <span class="ruby-keyword kw">else</span>
299
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">CommandOptionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">optchar</span>.<span class="ruby-identifier">chr</span>, <span class="ruby-identifier">:unknown_option</span>)
300
+ <span class="ruby-keyword kw">end</span>
301
+ <span class="ruby-keyword kw">end</span>
302
+ <span class="ruby-keyword kw">end</span>
303
+ <span class="ruby-comment cmt">#</span>
304
+ <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt"># end of while</span>
305
+
306
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>, <span class="ruby-identifier">properties</span>
307
+ <span class="ruby-keyword kw">end</span>
308
308
  </pre>
309
309
  </div>
310
310
  </div>
@@ -70,6 +70,10 @@
70
70
  <a href="../files/kwalify/meta-validator_rb.html">
71
71
  kwalify/meta-validator.rb
72
72
  </a>
73
+ <br />
74
+ <a href="../files/kwalify/parser/yaml_rb.html">
75
+ kwalify/parser/yaml.rb
76
+ </a>
73
77
  <br />
74
78
  <a href="../files/kwalify/rule_rb.html">
75
79
  kwalify/rule.rb
@@ -82,6 +86,18 @@
82
86
  <a href="../files/kwalify/util/hash-interface_rb.html">
83
87
  kwalify/util/hash-interface.rb
84
88
  </a>
89
+ <br />
90
+ <a href="../files/kwalify/util/hashlike_rb.html">
91
+ kwalify/util/hashlike.rb
92
+ </a>
93
+ <br />
94
+ <a href="../files/kwalify/util/ordered-hash_rb.html">
95
+ kwalify/util/ordered-hash.rb
96
+ </a>
97
+ <br />
98
+ <a href="../files/kwalify/util_rb.html">
99
+ kwalify/util.rb
100
+ </a>
85
101
  <br />
86
102
  <a href="../files/kwalify/validator_rb.html">
87
103
  kwalify/validator.rb
@@ -110,7 +126,8 @@
110
126
 
111
127
  <div id="description">
112
128
  <p>
113
- $Rev: 48 $ $Release: 0.6.1 $ copyright(c) 2005 kuwata-lab all rights reserved.
129
+ require &#8216;kwalify/parser/base&#8217; require
130
+ &#8216;kwalify/parser/yaml&#8216;
114
131
  </p>
115
132
 
116
133
  </div>
@@ -140,9 +157,13 @@ $Rev: 48 $ $Release: 0.6.1 $ copyright(c) 2005 kuwata-lab all rights reserved.
140
157
 
141
158
  Module <a href="Kwalify/ErrorHelper.html" class="link">Kwalify::ErrorHelper</a><br />
142
159
  Module <a href="Kwalify/HashInterface.html" class="link">Kwalify::HashInterface</a><br />
160
+ Module <a href="Kwalify/Json.html" class="link">Kwalify::Json</a><br />
143
161
  Module <a href="Kwalify/Types.html" class="link">Kwalify::Types</a><br />
162
+ Module <a href="Kwalify/Util.html" class="link">Kwalify::Util</a><br />
163
+ Module <a href="Kwalify/Yaml.html" class="link">Kwalify::Yaml</a><br />
144
164
  Class <a href="Kwalify/AssertionError.html" class="link">Kwalify::AssertionError</a><br />
145
165
  Class <a href="Kwalify/BaseError.html" class="link">Kwalify::BaseError</a><br />
166
+ Class <a href="Kwalify/BaseParser.html" class="link">Kwalify::BaseParser</a><br />
146
167
  Class <a href="Kwalify/CommandOptionError.html" class="link">Kwalify::CommandOptionError</a><br />
147
168
  Class <a href="Kwalify/KwalifyError.html" class="link">Kwalify::KwalifyError</a><br />
148
169
  Class <a href="Kwalify/Main.html" class="link">Kwalify::Main</a><br />
@@ -151,6 +172,7 @@ Class <a href="Kwalify/Parser.html" class="link">Kwalify::Parser</a><br />
151
172
  Class <a href="Kwalify/PlainYamlParser.html" class="link">Kwalify::PlainYamlParser</a><br />
152
173
  Class <a href="Kwalify/Rule.html" class="link">Kwalify::Rule</a><br />
153
174
  Class <a href="Kwalify/SchemaError.html" class="link">Kwalify::SchemaError</a><br />
175
+ Class <a href="Kwalify/SyntaxError.html" class="link">Kwalify::SyntaxError</a><br />
154
176
  Class <a href="Kwalify/ValidationError.html" class="link">Kwalify::ValidationError</a><br />
155
177
  Class <a href="Kwalify/Validator.html" class="link">Kwalify::Validator</a><br />
156
178
  Class <a href="Kwalify/YamlParser.html" class="link">Kwalify::YamlParser</a><br />
@@ -171,7 +193,7 @@ Class <a href="Kwalify/YamlSyntaxError.html" class="link">Kwalify::YamlSyntaxErr
171
193
  <tr class="top-aligned-row context-row">
172
194
  <td class="context-item-name">RELEASE</td>
173
195
  <td>=</td>
174
- <td class="context-item-value">(&quot;$Release: 0.6.1 $&quot; =~ /[.\d]+/) &amp;&amp; $&amp;</td>
196
+ <td class="context-item-value">(&quot;$Release: 0.7.0 $&quot; =~ /[.\d]+/) &amp;&amp; $&amp;</td>
175
197
  </tr>
176
198
  </table>
177
199
  </div>
@@ -200,10 +222,10 @@ Class <a href="Kwalify/YamlSyntaxError.html" class="link">Kwalify::YamlSyntaxErr
200
222
  onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
201
223
  <div class="method-source-code" id="M000007-source">
202
224
  <pre>
203
- <span class="ruby-comment cmt"># File kwalify/meta-validator.rb, line 352</span>
204
- <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">meta_validator</span> <span class="ruby-comment cmt"># obsolete</span>
205
- <span class="ruby-keyword kw">return</span> <span class="ruby-constant">META_VALIDATOR</span>
206
- <span class="ruby-keyword kw">end</span>
225
+ <span class="ruby-comment cmt"># File kwalify/meta-validator.rb, line 271</span>
226
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">meta_validator</span> <span class="ruby-comment cmt"># obsolete</span>
227
+ <span class="ruby-keyword kw">return</span> <span class="ruby-constant">META_VALIDATOR</span>
228
+ <span class="ruby-keyword kw">end</span>
207
229
  </pre>
208
230
  </div>
209
231
  </div>
@@ -246,7 +268,7 @@ Class <a href="Kwalify/YamlSyntaxError.html" class="link">Kwalify::YamlSyntaxErr
246
268
  onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
247
269
  <div class="method-source-code" id="M000006-source">
248
270
  <pre>
249
- <span class="ruby-comment cmt"># File kwalify/messages.rb, line 150</span>
271
+ <span class="ruby-comment cmt"># File kwalify/messages.rb, line 164</span>
250
272
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">word</span>(<span class="ruby-identifier">key</span>)
251
273
  <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@@words</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">key</span>
252
274
  <span class="ruby-keyword kw">end</span>
@@ -88,7 +88,7 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000062">new</a>&nbsp;&nbsp;
91
+ <a href="#M000124">new</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -110,24 +110,24 @@
110
110
  <div id="methods">
111
111
  <h3 class="section-bar">Public Class methods</h3>
112
112
 
113
- <div id="method-M000062" class="method-detail">
114
- <a name="M000062"></a>
113
+ <div id="method-M000124" class="method-detail">
114
+ <a name="M000124"></a>
115
115
 
116
116
  <div class="method-heading">
117
- <a href="#M000062" class="method-signature">
117
+ <a href="#M000124" class="method-signature">
118
118
  <span class="method-name">new</span><span class="method-args">(msg)</span>
119
119
  </a>
120
120
  </div>
121
121
 
122
122
  <div class="method-description">
123
123
  <p><a class="source-toggle" href="#"
124
- onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
125
- <div class="method-source-code" id="M000062-source">
124
+ onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
125
+ <div class="method-source-code" id="M000124-source">
126
126
  <pre>
127
127
  <span class="ruby-comment cmt"># File kwalify/errors.rb, line 16</span>
128
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>)
129
- <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">&quot;*** assertion error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>)
130
- <span class="ruby-keyword kw">end</span>
128
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>)
129
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">&quot;*** assertion error: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>)
130
+ <span class="ruby-keyword kw">end</span>
131
131
  </pre>
132
132
  </div>
133
133
  </div>
@@ -88,11 +88,10 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000035">&lt;=&gt;</a>&nbsp;&nbsp;
92
- <a href="#M000033">message</a>&nbsp;&nbsp;
93
- <a href="#M000031">new</a>&nbsp;&nbsp;
94
- <a href="#M000032">path</a>&nbsp;&nbsp;
95
- <a href="#M000034">to_s</a>&nbsp;&nbsp;
91
+ <a href="#M000084">&lt;=&gt;</a>&nbsp;&nbsp;
92
+ <a href="#M000081">new</a>&nbsp;&nbsp;
93
+ <a href="#M000082">path</a>&nbsp;&nbsp;
94
+ <a href="#M000083">to_s</a>&nbsp;&nbsp;
96
95
  </div>
97
96
  </div>
98
97
 
@@ -112,8 +111,13 @@
112
111
  <table summary="aliases">
113
112
  <tr class="top-aligned-row context-row">
114
113
  <td class="context-item-name">to_s</td>
115
- <td>-></td>
114
+ <td>-&gt;</td>
116
115
  <td class="context-item-value">_to_s</td>
116
+ </tr>
117
+ <tr class="top-aligned-row context-row">
118
+ <td class="context-item-name">to_s</td>
119
+ <td>-&gt;</td>
120
+ <td class="context-item-value">message</td>
117
121
  </tr>
118
122
  </table>
119
123
  </div>
@@ -125,9 +129,19 @@
125
129
 
126
130
  <div class="name-list">
127
131
  <table>
132
+ <tr class="top-aligned-row context-row">
133
+ <td class="context-item-name">column</td>
134
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
135
+ <td class="context-item-desc"></td>
136
+ </tr>
128
137
  <tr class="top-aligned-row context-row">
129
138
  <td class="context-item-name">error_symbol</td>
130
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
139
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
140
+ <td class="context-item-desc"></td>
141
+ </tr>
142
+ <tr class="top-aligned-row context-row">
143
+ <td class="context-item-name">filename</td>
144
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
131
145
  <td class="context-item-desc"></td>
132
146
  </tr>
133
147
  <tr class="top-aligned-row context-row">
@@ -137,17 +151,17 @@
137
151
  </tr>
138
152
  <tr class="top-aligned-row context-row">
139
153
  <td class="context-item-name">path</td>
140
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
154
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
141
155
  <td class="context-item-desc"></td>
142
156
  </tr>
143
157
  <tr class="top-aligned-row context-row">
144
158
  <td class="context-item-name">rule</td>
145
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
159
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
146
160
  <td class="context-item-desc"></td>
147
161
  </tr>
148
162
  <tr class="top-aligned-row context-row">
149
163
  <td class="context-item-name">value</td>
150
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
164
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
151
165
  <td class="context-item-desc"></td>
152
166
  </tr>
153
167
  </table>
@@ -160,28 +174,28 @@
160
174
  <div id="methods">
161
175
  <h3 class="section-bar">Public Class methods</h3>
162
176
 
163
- <div id="method-M000031" class="method-detail">
164
- <a name="M000031"></a>
177
+ <div id="method-M000081" class="method-detail">
178
+ <a name="M000081"></a>
165
179
 
166
180
  <div class="method-heading">
167
- <a href="#M000031" class="method-signature">
181
+ <a href="#M000081" class="method-signature">
168
182
  <span class="method-name">new</span><span class="method-args">(message=&quot;&quot;, path=nil, value=nil, rule=nil, error_symbol=nil)</span>
169
183
  </a>
170
184
  </div>
171
185
 
172
186
  <div class="method-description">
173
187
  <p><a class="source-toggle" href="#"
174
- onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
175
- <div class="method-source-code" id="M000031-source">
188
+ onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
189
+ <div class="method-source-code" id="M000081-source">
176
190
  <pre>
177
191
  <span class="ruby-comment cmt"># File kwalify/errors.rb, line 23</span>
178
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>=<span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-identifier">path</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">rule</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">error_symbol</span>=<span class="ruby-keyword kw">nil</span>)
179
- <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
180
- <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>
181
- <span class="ruby-ivar">@rule</span> = <span class="ruby-identifier">rule</span>
182
- <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span>
183
- <span class="ruby-ivar">@error_symbol</span> = <span class="ruby-identifier">error_symbol</span>
184
- <span class="ruby-keyword kw">end</span>
192
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>=<span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-identifier">path</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">rule</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">error_symbol</span>=<span class="ruby-keyword kw">nil</span>)
193
+ <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">message</span>)
194
+ <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">path</span>
195
+ <span class="ruby-ivar">@rule</span> = <span class="ruby-identifier">rule</span>
196
+ <span class="ruby-ivar">@value</span> = <span class="ruby-identifier">value</span>
197
+ <span class="ruby-ivar">@error_symbol</span> = <span class="ruby-identifier">error_symbol</span>
198
+ <span class="ruby-keyword kw">end</span>
185
199
  </pre>
186
200
  </div>
187
201
  </div>
@@ -189,93 +203,80 @@
189
203
 
190
204
  <h3 class="section-bar">Public Instance methods</h3>
191
205
 
192
- <div id="method-M000035" class="method-detail">
193
- <a name="M000035"></a>
206
+ <div id="method-M000084" class="method-detail">
207
+ <a name="M000084"></a>
194
208
 
195
209
  <div class="method-heading">
196
- <a href="#M000035" class="method-signature">
210
+ <a href="#M000084" class="method-signature">
197
211
  <span class="method-name">&lt;=&gt;</span><span class="method-args">(ex)</span>
198
212
  </a>
199
213
  </div>
200
214
 
201
215
  <div class="method-description">
202
216
  <p><a class="source-toggle" href="#"
203
- onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
204
- <div class="method-source-code" id="M000035-source">
205
- <pre>
206
- <span class="ruby-comment cmt"># File kwalify/errors.rb, line 47</span>
207
- <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">ex</span>)
208
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@linenum</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">linenum</span>
209
- <span class="ruby-keyword kw">end</span>
210
- </pre>
211
- </div>
212
- </div>
213
- </div>
214
-
215
- <div id="method-M000033" class="method-detail">
216
- <a name="M000033"></a>
217
-
218
- <div class="method-heading">
219
- <a href="#M000033" class="method-signature">
220
- <span class="method-name">message</span><span class="method-args">()</span>
221
- </a>
222
- </div>
223
-
224
- <div class="method-description">
225
- <p><a class="source-toggle" href="#"
226
- onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
227
- <div class="method-source-code" id="M000033-source">
217
+ onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
218
+ <div class="method-source-code" id="M000084-source">
228
219
  <pre>
229
- <span class="ruby-comment cmt"># File kwalify/errors.rb, line 39</span>
230
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>
231
- <span class="ruby-identifier">_to_s</span>
232
- <span class="ruby-keyword kw">end</span>
220
+ <span class="ruby-comment cmt"># File kwalify/errors.rb, line 49</span>
221
+ <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">ex</span>)
222
+ <span class="ruby-comment cmt">#return @linenum &lt;=&gt; ex.linenum</span>
223
+ <span class="ruby-identifier">v</span> = <span class="ruby-value">0</span>
224
+ <span class="ruby-identifier">v</span> = <span class="ruby-ivar">@linenum</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">linenum</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@linenum</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">linenum</span>
225
+ <span class="ruby-identifier">v</span> = <span class="ruby-ivar">@column</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">column</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@column</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">column</span>
226
+ <span class="ruby-identifier">v</span> = <span class="ruby-ivar">@path</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
227
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">v</span>
228
+ <span class="ruby-keyword kw">end</span>
233
229
  </pre>
234
230
  </div>
235
231
  </div>
236
232
  </div>
237
233
 
238
- <div id="method-M000032" class="method-detail">
239
- <a name="M000032"></a>
234
+ <div id="method-M000082" class="method-detail">
235
+ <a name="M000082"></a>
240
236
 
241
237
  <div class="method-heading">
242
- <a href="#M000032" class="method-signature">
238
+ <a href="#M000082" class="method-signature">
243
239
  <span class="method-name">path</span><span class="method-args">()</span>
244
240
  </a>
245
241
  </div>
246
242
 
247
243
  <div class="method-description">
248
244
  <p><a class="source-toggle" href="#"
249
- onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
250
- <div class="method-source-code" id="M000032-source">
245
+ onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
246
+ <div class="method-source-code" id="M000082-source">
251
247
  <pre>
252
248
  <span class="ruby-comment cmt"># File kwalify/errors.rb, line 33</span>
253
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
254
- <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">''</span> <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@path</span>
255
- <span class="ruby-keyword kw">end</span>
249
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
250
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">''</span> <span class="ruby-operator">?</span> <span class="ruby-value str">&quot;/&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@path</span>
251
+ <span class="ruby-keyword kw">end</span>
256
252
  </pre>
257
253
  </div>
258
254
  </div>
259
255
  </div>
260
256
 
261
- <div id="method-M000034" class="method-detail">
262
- <a name="M000034"></a>
257
+ <div id="method-M000083" class="method-detail">
258
+ <a name="M000083"></a>
263
259
 
264
260
  <div class="method-heading">
265
- <a href="#M000034" class="method-signature">
261
+ <a href="#M000083" class="method-signature">
266
262
  <span class="method-name">to_s</span><span class="method-args">()</span>
267
263
  </a>
268
264
  </div>
269
265
 
270
266
  <div class="method-description">
271
267
  <p><a class="source-toggle" href="#"
272
- onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
273
- <div class="method-source-code" id="M000034-source">
268
+ onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
269
+ <div class="method-source-code" id="M000083-source">
274
270
  <pre>
275
- <span class="ruby-comment cmt"># File kwalify/errors.rb, line 43</span>
276
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
277
- <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;[#{path()}] #{message()}&quot;</span>
278
- <span class="ruby-keyword kw">end</span>
271
+ <span class="ruby-comment cmt"># File kwalify/errors.rb, line 40</span>
272
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
273
+ <span class="ruby-identifier">s</span> = <span class="ruby-value str">''</span>
274
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@filename</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;:&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@filename</span>
275
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{@linenum}:#{@column} &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@linenum</span>
276
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;[#{path()}] &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path</span>
277
+ <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">_to_s</span>()
278
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">s</span>
279
+ <span class="ruby-keyword kw">end</span>
279
280
  </pre>
280
281
  </div>
281
282
  </div>