kwalify 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +232 -0
- data/MIT-LICENSE +20 -0
- data/README.txt +16 -19
- data/bin/kwalify +3 -3
- data/contrib/inline-require +6 -4
- data/contrib/kwalify +3719 -2427
- data/doc-api/classes/CommandOptionError.html +17 -17
- data/doc-api/classes/CommandOptionParser.html +63 -63
- data/doc-api/classes/Kwalify.html +29 -7
- data/doc-api/classes/Kwalify/AssertionError.html +9 -9
- data/doc-api/classes/Kwalify/BaseError.html +72 -71
- data/doc-api/classes/Kwalify/BaseParser.html +461 -0
- data/doc-api/classes/Kwalify/CommandOptionError.html +11 -11
- data/doc-api/classes/Kwalify/ErrorHelper.html +51 -46
- data/doc-api/classes/Kwalify/HashInterface.html +13 -135
- data/doc-api/classes/Kwalify/Json.html +105 -0
- data/doc-api/classes/Kwalify/Main.html +129 -126
- data/doc-api/classes/Kwalify/MetaValidator.html +248 -232
- data/doc-api/classes/Kwalify/Parser.html +12 -12
- data/doc-api/classes/Kwalify/PlainYamlParser.html +166 -163
- data/doc-api/classes/Kwalify/PlainYamlParser/Alias.html +11 -11
- data/doc-api/classes/Kwalify/Rule.html +152 -130
- data/doc-api/classes/Kwalify/SchemaError.html +10 -10
- data/doc-api/classes/Kwalify/SyntaxError.html +185 -0
- data/doc-api/classes/Kwalify/Types.html +26 -25
- data/doc-api/classes/Kwalify/Util.html +389 -0
- data/doc-api/classes/Kwalify/Util/HashLike.html +246 -0
- data/doc-api/classes/Kwalify/Util/OrderedHash.html +330 -0
- data/doc-api/classes/Kwalify/ValidationError.html +10 -10
- data/doc-api/classes/Kwalify/Validator.html +153 -86
- data/doc-api/classes/Kwalify/Yaml.html +181 -0
- data/doc-api/classes/Kwalify/Yaml/Parser.html +1538 -0
- data/doc-api/classes/Kwalify/YamlParser.html +190 -183
- data/doc-api/classes/Kwalify/YamlSyntaxError.html +8 -57
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +17 -22
- data/doc-api/files/kwalify/errors_rb.html +2 -2
- data/doc-api/files/kwalify/main_rb.html +4 -3
- data/doc-api/files/kwalify/messages_rb.html +2 -2
- data/doc-api/files/kwalify/meta-validator_rb.html +3 -3
- data/doc-api/files/kwalify/{util/yaml-helper_rb.html → parser/base_rb.html} +8 -6
- data/doc-api/files/kwalify/parser/yaml_rb.html +117 -0
- data/doc-api/files/kwalify/rule_rb.html +2 -2
- data/doc-api/files/kwalify/types_rb.html +2 -2
- data/doc-api/files/kwalify/util/assert-text-equal_rb.html +2 -2
- data/doc-api/files/kwalify/util/hash-interface_rb.html +9 -2
- data/doc-api/files/kwalify/util/hashlike_rb.html +107 -0
- data/doc-api/files/kwalify/util/option-parser_rb.html +2 -2
- data/doc-api/files/kwalify/util/ordered-hash_rb.html +107 -0
- data/doc-api/files/kwalify/util/testcase-helper_rb.html +2 -2
- data/doc-api/files/kwalify/util_rb.html +107 -0
- data/doc-api/files/kwalify/validator_rb.html +2 -2
- data/doc-api/files/kwalify/yaml-parser_rb.html +2 -2
- data/doc-api/files/kwalify_rb.html +3 -2
- data/doc-api/fr_class_index.html +8 -1
- data/doc-api/fr_file_index.html +5 -1
- data/doc-api/fr_method_index.html +128 -69
- data/doc/img/fig01.png +0 -0
- data/doc/users-guide.html +882 -717
- data/examples/address-book/address-book.schema.yaml +2 -2
- data/examples/data-binding/BABEL.data.yaml +63 -0
- data/examples/data-binding/BABEL.schema.yaml +31 -0
- data/examples/data-binding/Makefile +8 -0
- data/examples/data-binding/Rakefile +13 -0
- data/examples/data-binding/main.rb +27 -0
- data/examples/invoice/invoice.schema.yaml +3 -3
- data/examples/tapkit/tapkit.schema.yaml +2 -2
- data/lib/kwalify.rb +41 -4
- data/lib/kwalify/errors.rb +118 -96
- data/lib/kwalify/kwalify.schema.yaml +58 -0
- data/lib/kwalify/main.rb +384 -377
- data/lib/kwalify/messages.rb +41 -27
- data/lib/kwalify/meta-validator.rb +251 -331
- data/lib/kwalify/parser/base.rb +127 -0
- data/lib/kwalify/parser/yaml.rb +837 -0
- data/lib/kwalify/rule.rb +545 -487
- data/lib/kwalify/templates/genclass-java.eruby +189 -162
- data/lib/kwalify/templates/genclass-php.eruby +104 -0
- data/lib/kwalify/templates/genclass-ruby.eruby +95 -66
- data/lib/kwalify/types.rb +107 -106
- data/lib/kwalify/util.rb +157 -0
- data/lib/kwalify/util/assert-text-equal.rb +33 -31
- data/lib/kwalify/util/hash-interface.rb +11 -30
- data/lib/kwalify/util/hashlike.rb +51 -0
- data/lib/kwalify/util/option-parser.rb +144 -144
- data/lib/kwalify/util/ordered-hash.rb +57 -0
- data/lib/kwalify/util/testcase-helper.rb +3 -3
- data/lib/kwalify/validator.rb +267 -212
- data/lib/kwalify/yaml-parser.rb +822 -768
- data/setup.rb +861 -607
- data/test/Rookbook.yaml +10 -0
- data/test/{tmp.dir/Context.java → data/users-guide/AddressBook.java.expected} +11 -11
- data/test/data/users-guide/BABEL.data.yaml +24 -0
- data/test/data/users-guide/BABEL.schema.yaml +30 -0
- data/test/data/users-guide/ExampleAddressBook.java +47 -0
- data/test/{tmp.dir/Group.java → data/users-guide/Group.java.expected} +2 -11
- data/test/data/users-guide/Person.java.expected +44 -0
- data/test/data/users-guide/address_book.rb +52 -0
- data/test/data/users-guide/address_book.schema.yaml +28 -0
- data/test/data/users-guide/address_book.yaml +27 -0
- data/test/data/users-guide/answers-schema.yaml +12 -0
- data/test/data/users-guide/answers-validator.rb +52 -0
- data/test/data/users-guide/babel_genclass.result +26 -0
- data/test/data/users-guide/config.schema.yaml +7 -0
- data/test/data/users-guide/config.yaml +4 -0
- data/test/{tmp.dir/silent1.document → data/users-guide/document01a.yaml} +0 -0
- data/test/data/users-guide/document01b.yaml +3 -0
- data/test/data/users-guide/document02a.yaml +4 -0
- data/test/data/users-guide/document02b.yaml +4 -0
- data/test/data/users-guide/document03a.yaml +6 -0
- data/test/data/users-guide/document03b.yaml +6 -0
- data/test/data/users-guide/document04a.yaml +9 -0
- data/test/data/users-guide/document04b.yaml +9 -0
- data/test/data/users-guide/document05a.yaml +11 -0
- data/test/data/users-guide/document05b.yaml +12 -0
- data/test/data/users-guide/document06a.yaml +15 -0
- data/test/data/users-guide/document06b.yaml +16 -0
- data/test/data/users-guide/document07a.yaml +9 -0
- data/test/data/users-guide/document07b.yaml +7 -0
- data/test/data/users-guide/document12a.json +10 -0
- data/test/data/users-guide/document12b.json +6 -0
- data/test/data/users-guide/document13a.yaml +17 -0
- data/test/data/users-guide/document14a.yaml +3 -0
- data/test/data/users-guide/document14b.yaml +3 -0
- data/test/data/users-guide/document15a.yaml +6 -0
- data/test/data/users-guide/document15b.yaml +5 -0
- data/test/data/users-guide/example_address_book.rb +10 -0
- data/test/data/users-guide/example_address_book_java.result +32 -0
- data/test/data/users-guide/example_address_book_ruby.result +31 -0
- data/test/data/users-guide/genclass_java.result +4 -0
- data/test/data/users-guide/howto-validation-with-parsing.rb +28 -0
- data/test/data/users-guide/howto-validation.rb +25 -0
- data/test/data/users-guide/howto3.rb +6 -0
- data/test/data/users-guide/howto3.result +5 -0
- data/test/data/users-guide/howto3.yaml +8 -0
- data/test/data/users-guide/howto5_databinding.result +111 -0
- data/test/data/users-guide/invalid01.result +3 -0
- data/test/data/users-guide/invalid02.result +5 -0
- data/test/data/users-guide/invalid03.result +5 -0
- data/test/data/users-guide/invalid04.result +4 -0
- data/test/data/users-guide/invalid05.result +11 -0
- data/test/data/users-guide/invalid06.result +4 -0
- data/test/data/users-guide/invalid07.result +3 -0
- data/test/data/users-guide/invalid08.result +3 -0
- data/test/data/users-guide/invalid12.json +8 -0
- data/test/data/users-guide/invalid14.result +4 -0
- data/test/data/users-guide/invalid15.result +4 -0
- data/test/data/users-guide/loadbabel.rb +27 -0
- data/test/data/users-guide/loadconfig.rb +15 -0
- data/test/data/users-guide/loadconfig.result +2 -0
- data/test/data/users-guide/models.rb +22 -0
- data/test/data/users-guide/option_ha.result +6 -0
- data/test/data/users-guide/option_ha_genclass_java.result +7 -0
- data/test/{tmp.dir/meta1.schema → data/users-guide/schema01.yaml} +0 -0
- data/test/data/users-guide/schema02.yaml +12 -0
- data/test/data/users-guide/schema03.yaml +9 -0
- data/test/data/users-guide/schema04.yaml +20 -0
- data/test/data/users-guide/schema05.yaml +29 -0
- data/test/data/users-guide/schema06.yaml +11 -0
- data/test/data/users-guide/schema12.json +12 -0
- data/test/data/users-guide/schema13.yaml +13 -0
- data/test/data/users-guide/schema14.yaml +5 -0
- data/test/data/users-guide/schema15.yaml +21 -0
- data/test/data/users-guide/valid01.result +2 -0
- data/test/data/users-guide/valid02.result +2 -0
- data/test/data/users-guide/valid03.result +2 -0
- data/test/data/users-guide/valid04.result +2 -0
- data/test/data/users-guide/valid05.result +2 -0
- data/test/data/users-guide/valid06.result +2 -0
- data/test/data/users-guide/valid07.result +2 -0
- data/test/data/users-guide/valid08.result +2 -0
- data/test/data/users-guide/valid12.result +2 -0
- data/test/data/users-guide/valid13.result +2 -0
- data/test/data/users-guide/valid14.result +2 -0
- data/test/data/users-guide/valid15.result +2 -0
- data/test/data/users-guide/validate08.rb +37 -0
- data/test/test-action.rb +78 -0
- data/test/test-action.yaml +738 -0
- data/test/test-databinding.rb +80 -0
- data/test/test-databinding.yaml +301 -0
- data/test/test-main.rb +129 -150
- data/test/test-main.yaml +126 -321
- data/test/test-metavalidator.rb +47 -47
- data/test/test-metavalidator.yaml +77 -21
- data/test/test-parser-yaml.rb +57 -0
- data/test/test-parser-yaml.yaml +1749 -0
- data/test/test-rule.rb +14 -15
- data/test/test-rule.yaml +6 -3
- data/test/test-users-guide.rb +75 -0
- data/test/test-validator.rb +77 -52
- data/test/test-validator.yaml +168 -6
- data/test/test-yaml-parser.rb +47 -0
- data/test/{test-yamlparser.yaml → test-yaml-parser.yaml} +159 -52
- data/test/test.rb +37 -21
- metadata +136 -37
- data/COPYING +0 -340
- data/ChangeLog +0 -70
- data/doc-api/classes/YamlHelper.html +0 -259
- data/lib/kwalify/util/yaml-helper.rb +0 -82
- data/test/test-yamlparser.rb +0 -58
- data/test/tmp.dir/User.java +0 -43
- data/test/tmp.dir/action1.document +0 -18
- data/test/tmp.dir/action1.schema +0 -32
- data/test/tmp.dir/action2.document +0 -18
- data/test/tmp.dir/action2.schema +0 -32
- data/test/tmp.dir/emacs.document +0 -6
- data/test/tmp.dir/emacs.schema +0 -6
- data/test/tmp.dir/meta1.document +0 -0
- data/test/tmp.dir/meta2.document +0 -0
- data/test/tmp.dir/meta2.schema +0 -3
- data/test/tmp.dir/silent1.schema +0 -3
- data/test/tmp.dir/silent2.document +0 -7
- data/test/tmp.dir/silent2.schema +0 -3
- data/test/tmp.dir/stream.invalid +0 -8
- data/test/tmp.dir/stream.schema +0 -3
- data/test/tmp.dir/stream.valid +0 -8
- data/test/tmp.dir/untabify.document +0 -5
- data/test/tmp.dir/untabify.schema +0 -10
- data/todo.txt +0 -34
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
|
-
$Rev:
|
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
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
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">"-%s: argument required."</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">"-%s: unknown option."</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">"-%s: invalid property."</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">"*** internal error(optchar=#{option}, error_symbol=#{error_symbol}) ***"</span>
|
162
161
|
<span class="ruby-keyword kw">end</span>
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
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
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
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">""</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">""</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">""</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
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
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">"null"</span>, <span class="ruby-value str">"nil"</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">"true"</span>, <span class="ruby-value str">"yes"</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">"false"</span>, <span class="ruby-value str">"no"</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".*"\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
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
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">&&</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">&&</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">""</span>
|
286
|
+
<span class="ruby-comment cmt">#puts "*** debug: optchar=#{optchar.chr}, optstr=#{optstr.inspect}"</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
|
-
|
129
|
+
require ‘kwalify/parser/base’ require
|
130
|
+
‘kwalify/parser/yaml‘
|
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">("$Release: 0.
|
196
|
+
<td class="context-item-value">("$Release: 0.7.0 $" =~ /[.\d]+/) && $&</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
|
204
|
-
|
205
|
-
|
206
|
-
|
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
|
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="#
|
91
|
+
<a href="#M000124">new</a>
|
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-
|
114
|
-
<a name="
|
113
|
+
<div id="method-M000124" class="method-detail">
|
114
|
+
<a name="M000124"></a>
|
115
115
|
|
116
116
|
<div class="method-heading">
|
117
|
-
<a href="#
|
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('
|
125
|
-
<div class="method-source-code" id="
|
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
|
-
|
129
|
-
|
130
|
-
|
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">"*** assertion error: "</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="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
95
|
-
<a href="#M000034">to_s</a>
|
91
|
+
<a href="#M000084"><=></a>
|
92
|
+
<a href="#M000081">new</a>
|
93
|
+
<a href="#M000082">path</a>
|
94
|
+
<a href="#M000083">to_s</a>
|
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
|
114
|
+
<td>-></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>-></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"> [RW] </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"> [
|
139
|
+
<td class="context-item-value"> [RW] </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"> [RW] </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"> [
|
154
|
+
<td class="context-item-value"> [RW] </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"> [
|
159
|
+
<td class="context-item-value"> [RW] </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"> [
|
164
|
+
<td class="context-item-value"> [RW] </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-
|
164
|
-
<a name="
|
177
|
+
<div id="method-M000081" class="method-detail">
|
178
|
+
<a name="M000081"></a>
|
165
179
|
|
166
180
|
<div class="method-heading">
|
167
|
-
<a href="#
|
181
|
+
<a href="#M000081" class="method-signature">
|
168
182
|
<span class="method-name">new</span><span class="method-args">(message="", 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('
|
175
|
-
<div class="method-source-code" id="
|
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
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
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">""</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-
|
193
|
-
<a name="
|
206
|
+
<div id="method-M000084" class="method-detail">
|
207
|
+
<a name="M000084"></a>
|
194
208
|
|
195
209
|
<div class="method-heading">
|
196
|
-
<a href="#
|
210
|
+
<a href="#M000084" class="method-signature">
|
197
211
|
<span class="method-name"><=></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('
|
204
|
-
<div class="method-source-code" id="
|
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"><=></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"><=></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
|
230
|
-
|
231
|
-
|
232
|
-
<span class="ruby-
|
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"><=></span>(<span class="ruby-identifier">ex</span>)
|
222
|
+
<span class="ruby-comment cmt">#return @linenum <=> 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"><=></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">&&</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"><=></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">&&</span> <span class="ruby-ivar">@column</span> <span class="ruby-operator">&&</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"><=></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-
|
239
|
-
<a name="
|
234
|
+
<div id="method-M000082" class="method-detail">
|
235
|
+
<a name="M000082"></a>
|
240
236
|
|
241
237
|
<div class="method-heading">
|
242
|
-
<a href="#
|
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('
|
250
|
-
<div class="method-source-code" id="
|
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
|
-
|
254
|
-
|
255
|
-
|
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">"/"</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-
|
262
|
-
<a name="
|
257
|
+
<div id="method-M000083" class="method-detail">
|
258
|
+
<a name="M000083"></a>
|
263
259
|
|
264
260
|
<div class="method-heading">
|
265
|
-
<a href="#
|
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('
|
273
|
-
<div class="method-source-code" id="
|
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
|
276
|
-
|
277
|
-
|
278
|
-
<span class="ruby-keyword kw">
|
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"><<</span> <span class="ruby-ivar">@filename</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">":"</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"><<</span> <span class="ruby-node">"#{@linenum}:#{@column} "</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"><<</span> <span class="ruby-node">"[#{path()}] "</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"><<</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>
|