dc-kwalify 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.txt +252 -0
- data/MIT-LICENSE +20 -0
- data/README.txt +61 -0
- data/bin/kwalify +13 -0
- data/contrib/inline-require +179 -0
- data/contrib/kwalify +4160 -0
- data/doc/docstyle.css +188 -0
- data/doc/img/fig01.png +0 -0
- data/doc/users-guide.html +2050 -0
- data/doc-api/classes/CommandOptionError.html +184 -0
- data/doc-api/classes/CommandOptionParser.html +325 -0
- data/doc-api/classes/Kwalify/AssertionError.html +148 -0
- data/doc-api/classes/Kwalify/BaseError.html +297 -0
- data/doc-api/classes/Kwalify/BaseParser.html +461 -0
- data/doc-api/classes/Kwalify/CommandOptionError.html +168 -0
- data/doc-api/classes/Kwalify/ErrorHelper.html +223 -0
- data/doc-api/classes/Kwalify/HashInterface.html +118 -0
- data/doc-api/classes/Kwalify/Json.html +105 -0
- data/doc-api/classes/Kwalify/KwalifyError.html +111 -0
- data/doc-api/classes/Kwalify/Main.html +339 -0
- data/doc-api/classes/Kwalify/MetaValidator.html +448 -0
- data/doc-api/classes/Kwalify/Parser.html +155 -0
- data/doc-api/classes/Kwalify/PlainYamlParser/Alias.html +165 -0
- data/doc-api/classes/Kwalify/PlainYamlParser.html +523 -0
- data/doc-api/classes/Kwalify/Rule.html +433 -0
- data/doc-api/classes/Kwalify/SchemaError.html +148 -0
- data/doc-api/classes/Kwalify/SyntaxError.html +185 -0
- data/doc-api/classes/Kwalify/Types.html +302 -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/Util.html +390 -0
- data/doc-api/classes/Kwalify/ValidationError.html +148 -0
- data/doc-api/classes/Kwalify/Validator.html +381 -0
- data/doc-api/classes/Kwalify/Yaml/Parser.html +1538 -0
- data/doc-api/classes/Kwalify/Yaml.html +194 -0
- data/doc-api/classes/Kwalify/YamlParser.html +542 -0
- data/doc-api/classes/Kwalify/YamlSyntaxError.html +119 -0
- data/doc-api/classes/Kwalify.html +292 -0
- data/doc-api/classes/Test/Unit.html +101 -0
- data/doc-api/classes/Test.html +107 -0
- data/doc-api/created.rid +1 -0
- data/doc-api/files/__/README_txt.html +172 -0
- data/doc-api/files/kwalify/errors_rb.html +114 -0
- data/doc-api/files/kwalify/main_rb.html +118 -0
- data/doc-api/files/kwalify/messages_rb.html +107 -0
- data/doc-api/files/kwalify/meta-validator_rb.html +117 -0
- data/doc-api/files/kwalify/parser/base_rb.html +116 -0
- data/doc-api/files/kwalify/parser/yaml_rb.html +117 -0
- data/doc-api/files/kwalify/rule_rb.html +116 -0
- data/doc-api/files/kwalify/types_rb.html +114 -0
- data/doc-api/files/kwalify/util/assert-text-equal_rb.html +115 -0
- data/doc-api/files/kwalify/util/hash-interface_rb.html +114 -0
- data/doc-api/files/kwalify/util/hashlike_rb.html +107 -0
- data/doc-api/files/kwalify/util/option-parser_rb.html +107 -0
- data/doc-api/files/kwalify/util/ordered-hash_rb.html +107 -0
- data/doc-api/files/kwalify/util/testcase-helper_rb.html +115 -0
- data/doc-api/files/kwalify/util_rb.html +107 -0
- data/doc-api/files/kwalify/validator_rb.html +117 -0
- data/doc-api/files/kwalify/yaml-parser_rb.html +117 -0
- data/doc-api/files/kwalify_rb.html +121 -0
- data/doc-api/fr_class_index.html +57 -0
- data/doc-api/fr_file_index.html +45 -0
- data/doc-api/fr_method_index.html +168 -0
- data/doc-api/index.html +24 -0
- data/doc-api/rdoc-style.css +208 -0
- data/examples/address-book/Makefile +10 -0
- data/examples/address-book/address-book.schema.yaml +45 -0
- data/examples/address-book/address-book.yaml +36 -0
- 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/Makefile +9 -0
- data/examples/invoice/invoice.schema.yaml +43 -0
- data/examples/invoice/invoice.yaml +32 -0
- data/examples/tapkit/Makefile +10 -0
- data/examples/tapkit/main.rb +7 -0
- data/examples/tapkit/tapkit.schema.yaml +146 -0
- data/examples/tapkit/tapkit.yaml +85 -0
- data/lib/kwalify/errors.rb +127 -0
- data/lib/kwalify/kwalify.schema.yaml +58 -0
- data/lib/kwalify/main.rb +442 -0
- data/lib/kwalify/messages.rb +173 -0
- data/lib/kwalify/meta-validator.rb +275 -0
- data/lib/kwalify/parser/base.rb +127 -0
- data/lib/kwalify/parser/yaml.rb +841 -0
- data/lib/kwalify/rule.rb +559 -0
- data/lib/kwalify/templates/genclass-java.eruby +222 -0
- data/lib/kwalify/templates/genclass-php.eruby +104 -0
- data/lib/kwalify/templates/genclass-ruby.eruby +113 -0
- data/lib/kwalify/types.rb +156 -0
- data/lib/kwalify/util/assert-text-equal.rb +46 -0
- data/lib/kwalify/util/hash-interface.rb +18 -0
- data/lib/kwalify/util/hashlike.rb +51 -0
- data/lib/kwalify/util/option-parser.rb +220 -0
- data/lib/kwalify/util/ordered-hash.rb +57 -0
- data/lib/kwalify/util/testcase-helper.rb +112 -0
- data/lib/kwalify/util.rb +158 -0
- data/lib/kwalify/validator.rb +282 -0
- data/lib/kwalify/yaml-parser.rb +870 -0
- data/lib/kwalify.rb +67 -0
- data/setup.rb +1585 -0
- data/test/Rookbook.yaml +10 -0
- data/test/data/users-guide/AddressBook.java.expected +40 -0
- 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/data/users-guide/Group.java.expected +24 -0
- 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/data/users-guide/document01a.yaml +3 -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 +16 -0
- data/test/data/users-guide/loadconfig.result +6 -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/data/users-guide/schema01.yaml +3 -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 +83 -0
- data/test/test-databinding.yaml +339 -0
- data/test/test-main.rb +157 -0
- data/test/test-main.yaml +415 -0
- data/test/test-metavalidator.rb +80 -0
- data/test/test-metavalidator.yaml +1179 -0
- data/test/test-parser-yaml.rb +57 -0
- data/test/test-parser-yaml.yaml +1749 -0
- data/test/test-rule.rb +26 -0
- data/test/test-rule.yaml +317 -0
- data/test/test-users-guide.rb +75 -0
- data/test/test-util.rb +125 -0
- data/test/test-validator.rb +95 -0
- data/test/test-validator.yaml +986 -0
- data/test/test-yaml-parser.rb +47 -0
- data/test/test-yaml-parser.yaml +1226 -0
- data/test/test.rb +61 -0
- metadata +274 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: CommandOptionError</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">CommandOptionError</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/kwalify/util/option-parser_rb.html">
|
|
59
|
+
kwalify/util/option-parser.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
StandardError
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
$Rev$ $Release: 0.7.2 $ copyright(c) 2005-2010 kuwata-lab all rights reserved.
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div id="method-list">
|
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
|
93
|
+
|
|
94
|
+
<div class="name-list">
|
|
95
|
+
<a href="#M000004">new</a>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<!-- if includes -->
|
|
103
|
+
|
|
104
|
+
<div id="section">
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<div id="attribute-list">
|
|
111
|
+
<h3 class="section-bar">Attributes</h3>
|
|
112
|
+
|
|
113
|
+
<div class="name-list">
|
|
114
|
+
<table>
|
|
115
|
+
<tr class="top-aligned-row context-row">
|
|
116
|
+
<td class="context-item-name">error_symbol</td>
|
|
117
|
+
<td class="context-item-value"> [R] </td>
|
|
118
|
+
<td class="context-item-desc"></td>
|
|
119
|
+
</tr>
|
|
120
|
+
<tr class="top-aligned-row context-row">
|
|
121
|
+
<td class="context-item-name">option</td>
|
|
122
|
+
<td class="context-item-value"> [R] </td>
|
|
123
|
+
<td class="context-item-desc"></td>
|
|
124
|
+
</tr>
|
|
125
|
+
</table>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<!-- if method_list -->
|
|
132
|
+
<div id="methods">
|
|
133
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
134
|
+
|
|
135
|
+
<div id="method-M000004" class="method-detail">
|
|
136
|
+
<a name="M000004"></a>
|
|
137
|
+
|
|
138
|
+
<div class="method-heading">
|
|
139
|
+
<a href="#M000004" class="method-signature">
|
|
140
|
+
<span class="method-name">new</span><span class="method-args">(option, error_symbol, message=nil)</span>
|
|
141
|
+
</a>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div class="method-description">
|
|
145
|
+
<p><a class="source-toggle" href="#"
|
|
146
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
147
|
+
<div class="method-source-code" id="M000004-source">
|
|
148
|
+
<pre>
|
|
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">"-%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>
|
|
161
|
+
<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
|
+
</pre>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<div id="validator-badges">
|
|
180
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
</body>
|
|
184
|
+
</html>
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: CommandOptionParser</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">CommandOptionParser</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/kwalify/util/option-parser_rb.html">
|
|
59
|
+
kwalify/util/option-parser.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
ex.
|
|
84
|
+
</p>
|
|
85
|
+
<pre>
|
|
86
|
+
## create parser
|
|
87
|
+
arg_none = "hv" # ex. -h -v
|
|
88
|
+
arg_required = "xf" # ex. -x suffix -f filename
|
|
89
|
+
arg_optional = "i" # ex. -i (or -i10)
|
|
90
|
+
parser = CommandOptionParser.new(arg_none, arg_required, arg_optional)
|
|
91
|
+
|
|
92
|
+
## parse options
|
|
93
|
+
argv = %w[-h -v -f filename -i 10 aaa bbb]
|
|
94
|
+
options, properties = parser.parse(argv)
|
|
95
|
+
p options #=> { ?h=>true, ?v=>true, ?f=>"filename", ?i=>true }
|
|
96
|
+
p argv #=> ["10", "aaa", "bbb"]
|
|
97
|
+
|
|
98
|
+
## parse options #2
|
|
99
|
+
argv = %w[-hvx.txt -ffilename -i10 aaa bbb]
|
|
100
|
+
options, properties = parser.parse(argv)
|
|
101
|
+
p options #=> { ?h=>true, ?v=>true, ?x=>".txt", ?f=>"filename", ?i=>10 }
|
|
102
|
+
p argv #=> ["aaa", "bbb"]
|
|
103
|
+
|
|
104
|
+
## parse properties
|
|
105
|
+
argv = %w[-hi --index=10 --user-name=foo --help]
|
|
106
|
+
options, properties = parser.parse(argv)
|
|
107
|
+
p options #=> {?h=>true, ?i=>true}
|
|
108
|
+
p properties #=> {"index"=>"10", "user-name"=>"foo", "help"=>nil}
|
|
109
|
+
|
|
110
|
+
## parse properties with auto-convert
|
|
111
|
+
argv = %w[-hi --index=10 --user-name=foo --help]
|
|
112
|
+
options, properties = parser.parse(argv, true)
|
|
113
|
+
p options #=> {?h=>true, ?i=>true}
|
|
114
|
+
p properties #=> {:index=>10, :user_name=>foo, :help=>true}
|
|
115
|
+
|
|
116
|
+
## -a: unknown option.
|
|
117
|
+
argv = %w[-abc]
|
|
118
|
+
begin
|
|
119
|
+
options, properties = parser.parse(argv)
|
|
120
|
+
rescue CommandOptionError => ex
|
|
121
|
+
$stderr.puts ex.message # -a: unknown option.
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
## -f: argument required.
|
|
125
|
+
argv = %w[-f]
|
|
126
|
+
begin
|
|
127
|
+
options, properties = parser.parse(argv)
|
|
128
|
+
rescue CommandOptionError => ex
|
|
129
|
+
$stderr.puts ex.message # -f: argument required.
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
## --@prop=10: invalid property.
|
|
133
|
+
argv = %w[--@prop=10]
|
|
134
|
+
begin
|
|
135
|
+
options, properties = parser.parse(argv)
|
|
136
|
+
rescue CommandOptionError => ex
|
|
137
|
+
$stderr.puts ex.message # --@prop=10: invalid property.
|
|
138
|
+
end
|
|
139
|
+
</pre>
|
|
140
|
+
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<div id="method-list">
|
|
147
|
+
<h3 class="section-bar">Methods</h3>
|
|
148
|
+
|
|
149
|
+
<div class="name-list">
|
|
150
|
+
<a href="#M000001">new</a>
|
|
151
|
+
<a href="#M000003">parse</a>
|
|
152
|
+
<a href="#M000002">to_value</a>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<!-- if includes -->
|
|
160
|
+
|
|
161
|
+
<div id="section">
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<!-- if method_list -->
|
|
171
|
+
<div id="methods">
|
|
172
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
173
|
+
|
|
174
|
+
<div id="method-M000001" class="method-detail">
|
|
175
|
+
<a name="M000001"></a>
|
|
176
|
+
|
|
177
|
+
<div class="method-heading">
|
|
178
|
+
<a href="#M000001" class="method-signature">
|
|
179
|
+
<span class="method-name">new</span><span class="method-args">(arg_none=nil, arg_required=nil, arg_optional=nil)</span>
|
|
180
|
+
</a>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="method-description">
|
|
184
|
+
<p>
|
|
185
|
+
arg_none: option string which takes no argument arg_required: option string
|
|
186
|
+
which takes argument arg_otpional: option string which may takes argument
|
|
187
|
+
optionally
|
|
188
|
+
</p>
|
|
189
|
+
<p><a class="source-toggle" href="#"
|
|
190
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
|
191
|
+
<div class="method-source-code" id="M000001-source">
|
|
192
|
+
<pre>
|
|
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">""</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
|
+
</pre>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div id="method-M000002" class="method-detail">
|
|
205
|
+
<a name="M000002"></a>
|
|
206
|
+
|
|
207
|
+
<div class="method-heading">
|
|
208
|
+
<a href="#M000002" class="method-signature">
|
|
209
|
+
<span class="method-name">to_value</span><span class="method-args">(str)</span>
|
|
210
|
+
</a>
|
|
211
|
+
</div>
|
|
212
|
+
|
|
213
|
+
<div class="method-description">
|
|
214
|
+
<p><a class="source-toggle" href="#"
|
|
215
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
216
|
+
<div class="method-source-code" id="M000002-source">
|
|
217
|
+
<pre>
|
|
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">"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
|
+
</pre>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
237
|
+
|
|
238
|
+
<div id="method-M000003" class="method-detail">
|
|
239
|
+
<a name="M000003"></a>
|
|
240
|
+
|
|
241
|
+
<div class="method-heading">
|
|
242
|
+
<a href="#M000003" class="method-signature">
|
|
243
|
+
<span class="method-name">parse</span><span class="method-args">(argv, auto_convert=false)</span>
|
|
244
|
+
</a>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div class="method-description">
|
|
248
|
+
<table>
|
|
249
|
+
<tr><td valign="top">argv:</td><td>array of string
|
|
250
|
+
|
|
251
|
+
</td></tr>
|
|
252
|
+
<tr><td valign="top">auto_convert:</td><td>if true, convert properties value to int, boolean, string, regexp, …
|
|
253
|
+
(default false)
|
|
254
|
+
|
|
255
|
+
</td></tr>
|
|
256
|
+
</table>
|
|
257
|
+
<p><a class="source-toggle" href="#"
|
|
258
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
259
|
+
<div class="method-source-code" id="M000003-source">
|
|
260
|
+
<pre>
|
|
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">&&</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
|
+
</pre>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
<div id="validator-badges">
|
|
321
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
</body>
|
|
325
|
+
</html>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: Kwalify::AssertionError</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">Kwalify::AssertionError</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../../files/kwalify/errors_rb.html">
|
|
59
|
+
kwalify/errors.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
<a href="KwalifyError.html">
|
|
69
|
+
KwalifyError
|
|
70
|
+
</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- banner header -->
|
|
76
|
+
|
|
77
|
+
<div id="bodyContent">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<div id="contextContent">
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div id="method-list">
|
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
|
89
|
+
|
|
90
|
+
<div class="name-list">
|
|
91
|
+
<a href="#M000135">new</a>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<!-- if includes -->
|
|
99
|
+
|
|
100
|
+
<div id="section">
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
<!-- if method_list -->
|
|
110
|
+
<div id="methods">
|
|
111
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
112
|
+
|
|
113
|
+
<div id="method-M000135" class="method-detail">
|
|
114
|
+
<a name="M000135"></a>
|
|
115
|
+
|
|
116
|
+
<div class="method-heading">
|
|
117
|
+
<a href="#M000135" class="method-signature">
|
|
118
|
+
<span class="method-name">new</span><span class="method-args">(msg)</span>
|
|
119
|
+
</a>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div class="method-description">
|
|
123
|
+
<p><a class="source-toggle" href="#"
|
|
124
|
+
onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
|
|
125
|
+
<div class="method-source-code" id="M000135-source">
|
|
126
|
+
<pre>
|
|
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">"*** assertion error: "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>)
|
|
130
|
+
<span class="ruby-keyword kw">end</span>
|
|
131
|
+
</pre>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<div id="validator-badges">
|
|
144
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
</body>
|
|
148
|
+
</html>
|