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
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
<div id="description">
|
84
84
|
<p>
|
85
|
-
|
85
|
+
alias of <a href="YamlParser.html">YamlParser</a> class
|
86
86
|
</p>
|
87
87
|
|
88
88
|
</div>
|
@@ -94,7 +94,7 @@ obsolete
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
97
|
+
<a href="#M000085">new</a>
|
98
98
|
</div>
|
99
99
|
</div>
|
100
100
|
|
@@ -116,25 +116,25 @@ obsolete
|
|
116
116
|
<div id="methods">
|
117
117
|
<h3 class="section-bar">Public Class methods</h3>
|
118
118
|
|
119
|
-
<div id="method-
|
120
|
-
<a name="
|
119
|
+
<div id="method-M000085" class="method-detail">
|
120
|
+
<a name="M000085"></a>
|
121
121
|
|
122
122
|
<div class="method-heading">
|
123
|
-
<a href="#
|
123
|
+
<a href="#M000085" class="method-signature">
|
124
124
|
<span class="method-name">new</span><span class="method-args">(yaml_str)</span>
|
125
125
|
</a>
|
126
126
|
</div>
|
127
127
|
|
128
128
|
<div class="method-description">
|
129
129
|
<p><a class="source-toggle" href="#"
|
130
|
-
onclick="toggleCode('
|
131
|
-
<div class="method-source-code" id="
|
130
|
+
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
|
131
|
+
<div class="method-source-code" id="M000085-source">
|
132
132
|
<pre>
|
133
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
133
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 863</span>
|
134
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">yaml_str</span>)
|
135
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">yaml_str</span>)
|
136
|
+
<span class="ruby-comment cmt">#warn "*** class Kwalify::Parser is obsolete. Please use Kwalify::YamlParser instead."</span>
|
137
|
+
<span class="ruby-keyword kw">end</span>
|
138
138
|
</pre>
|
139
139
|
</div>
|
140
140
|
</div>
|
@@ -80,6 +80,9 @@
|
|
80
80
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
|
+
base class of yaml parser
|
84
|
+
</p>
|
85
|
+
<p>
|
83
86
|
ex.
|
84
87
|
</p>
|
85
88
|
<pre>
|
@@ -98,21 +101,21 @@ ex.
|
|
98
101
|
<h3 class="section-bar">Methods</h3>
|
99
102
|
|
100
103
|
<div class="name-list">
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
115
|
-
<a href="#
|
104
|
+
<a href="#M000135">add_to_map</a>
|
105
|
+
<a href="#M000132">add_to_seq</a>
|
106
|
+
<a href="#M000134">create_mapping</a>
|
107
|
+
<a href="#M000139">create_scalar</a>
|
108
|
+
<a href="#M000131">create_sequence</a>
|
109
|
+
<a href="#M000140">current_line</a>
|
110
|
+
<a href="#M000141">current_linenum</a>
|
111
|
+
<a href="#M000129">has_next?</a>
|
112
|
+
<a href="#M000138">merge_map</a>
|
113
|
+
<a href="#M000127">new</a>
|
114
|
+
<a href="#M000128">parse</a>
|
115
|
+
<a href="#M000130">parse_all</a>
|
116
|
+
<a href="#M000137">set_default</a>
|
117
|
+
<a href="#M000136">set_map_with</a>
|
118
|
+
<a href="#M000133">set_seq_at</a>
|
116
119
|
</div>
|
117
120
|
</div>
|
118
121
|
|
@@ -140,28 +143,28 @@ ex.
|
|
140
143
|
<div id="methods">
|
141
144
|
<h3 class="section-bar">Public Class methods</h3>
|
142
145
|
|
143
|
-
<div id="method-
|
144
|
-
<a name="
|
146
|
+
<div id="method-M000127" class="method-detail">
|
147
|
+
<a name="M000127"></a>
|
145
148
|
|
146
149
|
<div class="method-heading">
|
147
|
-
<a href="#
|
150
|
+
<a href="#M000127" class="method-signature">
|
148
151
|
<span class="method-name">new</span><span class="method-args">(yaml_str)</span>
|
149
152
|
</a>
|
150
153
|
</div>
|
151
154
|
|
152
155
|
<div class="method-description">
|
153
156
|
<p><a class="source-toggle" href="#"
|
154
|
-
onclick="toggleCode('
|
155
|
-
<div class="method-source-code" id="
|
157
|
+
onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
|
158
|
+
<div class="method-source-code" id="M000127-source">
|
156
159
|
<pre>
|
157
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
160
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 36</span>
|
161
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">yaml_str</span>)
|
162
|
+
<span class="ruby-ivar">@lines</span> = <span class="ruby-identifier">yaml_str</span>.<span class="ruby-identifier">to_a</span>()
|
163
|
+
<span class="ruby-ivar">@line</span> = <span class="ruby-keyword kw">nil</span>
|
164
|
+
<span class="ruby-ivar">@linenum</span> = <span class="ruby-value">0</span>
|
165
|
+
<span class="ruby-ivar">@anchors</span> = {}
|
166
|
+
<span class="ruby-ivar">@aliases</span> = {}
|
167
|
+
<span class="ruby-keyword kw">end</span>
|
165
168
|
</pre>
|
166
169
|
</div>
|
167
170
|
</div>
|
@@ -169,80 +172,80 @@ ex.
|
|
169
172
|
|
170
173
|
<h3 class="section-bar">Public Instance methods</h3>
|
171
174
|
|
172
|
-
<div id="method-
|
173
|
-
<a name="
|
175
|
+
<div id="method-M000129" class="method-detail">
|
176
|
+
<a name="M000129"></a>
|
174
177
|
|
175
178
|
<div class="method-heading">
|
176
|
-
<a href="#
|
179
|
+
<a href="#M000129" class="method-signature">
|
177
180
|
<span class="method-name">has_next?</span><span class="method-args">()</span>
|
178
181
|
</a>
|
179
182
|
</div>
|
180
183
|
|
181
184
|
<div class="method-description">
|
182
185
|
<p><a class="source-toggle" href="#"
|
183
|
-
onclick="toggleCode('
|
184
|
-
<div class="method-source-code" id="
|
186
|
+
onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
|
187
|
+
<div class="method-source-code" id="M000129-source">
|
185
188
|
<pre>
|
186
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
187
|
-
|
188
|
-
|
189
|
-
|
189
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 55</span>
|
190
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_next?</span>
|
191
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@end_flag</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">'EOF'</span>
|
192
|
+
<span class="ruby-keyword kw">end</span>
|
190
193
|
</pre>
|
191
194
|
</div>
|
192
195
|
</div>
|
193
196
|
</div>
|
194
197
|
|
195
|
-
<div id="method-
|
196
|
-
<a name="
|
198
|
+
<div id="method-M000128" class="method-detail">
|
199
|
+
<a name="M000128"></a>
|
197
200
|
|
198
201
|
<div class="method-heading">
|
199
|
-
<a href="#
|
202
|
+
<a href="#M000128" class="method-signature">
|
200
203
|
<span class="method-name">parse</span><span class="method-args">()</span>
|
201
204
|
</a>
|
202
205
|
</div>
|
203
206
|
|
204
207
|
<div class="method-description">
|
205
208
|
<p><a class="source-toggle" href="#"
|
206
|
-
onclick="toggleCode('
|
207
|
-
<div class="method-source-code" id="
|
209
|
+
onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
|
210
|
+
<div class="method-source-code" id="M000128-source">
|
208
211
|
<pre>
|
209
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
<span class="ruby-keyword kw">end</span>
|
215
|
-
<span class="ruby-identifier">resolve_aliases</span>(<span class="ruby-identifier">data</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@aliases</span>.<span class="ruby-identifier">empty?</span>
|
216
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">data</span>
|
212
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 45</span>
|
213
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>()
|
214
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">parse_child</span>(<span class="ruby-value">0</span>)
|
215
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@end_flag</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'---'</span>
|
216
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">parse_child</span>(<span class="ruby-value">0</span>)
|
217
217
|
<span class="ruby-keyword kw">end</span>
|
218
|
+
<span class="ruby-identifier">resolve_aliases</span>(<span class="ruby-identifier">data</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@aliases</span>.<span class="ruby-identifier">empty?</span>
|
219
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">data</span>
|
220
|
+
<span class="ruby-keyword kw">end</span>
|
218
221
|
</pre>
|
219
222
|
</div>
|
220
223
|
</div>
|
221
224
|
</div>
|
222
225
|
|
223
|
-
<div id="method-
|
224
|
-
<a name="
|
226
|
+
<div id="method-M000130" class="method-detail">
|
227
|
+
<a name="M000130"></a>
|
225
228
|
|
226
229
|
<div class="method-heading">
|
227
|
-
<a href="#
|
230
|
+
<a href="#M000130" class="method-signature">
|
228
231
|
<span class="method-name">parse_all</span><span class="method-args">()</span>
|
229
232
|
</a>
|
230
233
|
</div>
|
231
234
|
|
232
235
|
<div class="method-description">
|
233
236
|
<p><a class="source-toggle" href="#"
|
234
|
-
onclick="toggleCode('
|
235
|
-
<div class="method-source-code" id="
|
237
|
+
onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
|
238
|
+
<div class="method-source-code" id="M000130-source">
|
236
239
|
<pre>
|
237
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
<span class="ruby-keyword kw">end</span>
|
244
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>
|
240
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 60</span>
|
241
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_all</span>
|
242
|
+
<span class="ruby-identifier">list</span> = []
|
243
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">has_next</span>()
|
244
|
+
<span class="ruby-identifier">doc</span> = <span class="ruby-identifier">parse</span>()
|
245
|
+
<span class="ruby-identifier">list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">doc</span>
|
245
246
|
<span class="ruby-keyword kw">end</span>
|
247
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">list</span>
|
248
|
+
<span class="ruby-keyword kw">end</span>
|
246
249
|
</pre>
|
247
250
|
</div>
|
248
251
|
</div>
|
@@ -250,256 +253,256 @@ ex.
|
|
250
253
|
|
251
254
|
<h3 class="section-bar">Protected Instance methods</h3>
|
252
255
|
|
253
|
-
<div id="method-
|
254
|
-
<a name="
|
256
|
+
<div id="method-M000135" class="method-detail">
|
257
|
+
<a name="M000135"></a>
|
255
258
|
|
256
259
|
<div class="method-heading">
|
257
|
-
<a href="#
|
260
|
+
<a href="#M000135" class="method-signature">
|
258
261
|
<span class="method-name">add_to_map</span><span class="method-args">(map, key, value, linenum)</span>
|
259
262
|
</a>
|
260
263
|
</div>
|
261
264
|
|
262
265
|
<div class="method-description">
|
263
266
|
<p><a class="source-toggle" href="#"
|
264
|
-
onclick="toggleCode('
|
265
|
-
<div class="method-source-code" id="
|
267
|
+
onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
|
268
|
+
<div class="method-source-code" id="M000135-source">
|
266
269
|
<pre>
|
267
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
268
|
-
|
269
|
-
|
270
|
-
|
270
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 89</span>
|
271
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_to_map</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>)
|
272
|
+
<span class="ruby-identifier">map</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
273
|
+
<span class="ruby-keyword kw">end</span>
|
271
274
|
</pre>
|
272
275
|
</div>
|
273
276
|
</div>
|
274
277
|
</div>
|
275
278
|
|
276
|
-
<div id="method-
|
277
|
-
<a name="
|
279
|
+
<div id="method-M000132" class="method-detail">
|
280
|
+
<a name="M000132"></a>
|
278
281
|
|
279
282
|
<div class="method-heading">
|
280
|
-
<a href="#
|
283
|
+
<a href="#M000132" class="method-signature">
|
281
284
|
<span class="method-name">add_to_seq</span><span class="method-args">(seq, value, linenum)</span>
|
282
285
|
</a>
|
283
286
|
</div>
|
284
287
|
|
285
288
|
<div class="method-description">
|
286
289
|
<p><a class="source-toggle" href="#"
|
287
|
-
onclick="toggleCode('
|
288
|
-
<div class="method-source-code" id="
|
290
|
+
onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
|
291
|
+
<div class="method-source-code" id="M000132-source">
|
289
292
|
<pre>
|
290
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
291
|
-
|
292
|
-
|
293
|
-
|
293
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 77</span>
|
294
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_to_seq</span>(<span class="ruby-identifier">seq</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>)
|
295
|
+
<span class="ruby-identifier">seq</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">value</span>
|
296
|
+
<span class="ruby-keyword kw">end</span>
|
294
297
|
</pre>
|
295
298
|
</div>
|
296
299
|
</div>
|
297
300
|
</div>
|
298
301
|
|
299
|
-
<div id="method-
|
300
|
-
<a name="
|
302
|
+
<div id="method-M000134" class="method-detail">
|
303
|
+
<a name="M000134"></a>
|
301
304
|
|
302
305
|
<div class="method-heading">
|
303
|
-
<a href="#
|
306
|
+
<a href="#M000134" class="method-signature">
|
304
307
|
<span class="method-name">create_mapping</span><span class="method-args">(linenum=nil)</span>
|
305
308
|
</a>
|
306
309
|
</div>
|
307
310
|
|
308
311
|
<div class="method-description">
|
309
312
|
<p><a class="source-toggle" href="#"
|
310
|
-
onclick="toggleCode('
|
311
|
-
<div class="method-source-code" id="
|
313
|
+
onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
|
314
|
+
<div class="method-source-code" id="M000134-source">
|
312
315
|
<pre>
|
313
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
314
|
-
|
315
|
-
|
316
|
-
|
316
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 85</span>
|
317
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_mapping</span>(<span class="ruby-identifier">linenum</span>=<span class="ruby-keyword kw">nil</span>)
|
318
|
+
<span class="ruby-keyword kw">return</span> {}
|
319
|
+
<span class="ruby-keyword kw">end</span>
|
317
320
|
</pre>
|
318
321
|
</div>
|
319
322
|
</div>
|
320
323
|
</div>
|
321
324
|
|
322
|
-
<div id="method-
|
323
|
-
<a name="
|
325
|
+
<div id="method-M000139" class="method-detail">
|
326
|
+
<a name="M000139"></a>
|
324
327
|
|
325
328
|
<div class="method-heading">
|
326
|
-
<a href="#
|
329
|
+
<a href="#M000139" class="method-signature">
|
327
330
|
<span class="method-name">create_scalar</span><span class="method-args">(value, linenum=nil)</span>
|
328
331
|
</a>
|
329
332
|
</div>
|
330
333
|
|
331
334
|
<div class="method-description">
|
332
335
|
<p><a class="source-toggle" href="#"
|
333
|
-
onclick="toggleCode('
|
334
|
-
<div class="method-source-code" id="
|
336
|
+
onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
|
337
|
+
<div class="method-source-code" id="M000139-source">
|
335
338
|
<pre>
|
336
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
337
|
-
|
338
|
-
|
339
|
-
|
339
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 107</span>
|
340
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_scalar</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>=<span class="ruby-keyword kw">nil</span>)
|
341
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">value</span>
|
342
|
+
<span class="ruby-keyword kw">end</span>
|
340
343
|
</pre>
|
341
344
|
</div>
|
342
345
|
</div>
|
343
346
|
</div>
|
344
347
|
|
345
|
-
<div id="method-
|
346
|
-
<a name="
|
348
|
+
<div id="method-M000131" class="method-detail">
|
349
|
+
<a name="M000131"></a>
|
347
350
|
|
348
351
|
<div class="method-heading">
|
349
|
-
<a href="#
|
352
|
+
<a href="#M000131" class="method-signature">
|
350
353
|
<span class="method-name">create_sequence</span><span class="method-args">(linenum=nil)</span>
|
351
354
|
</a>
|
352
355
|
</div>
|
353
356
|
|
354
357
|
<div class="method-description">
|
355
358
|
<p><a class="source-toggle" href="#"
|
356
|
-
onclick="toggleCode('
|
357
|
-
<div class="method-source-code" id="
|
359
|
+
onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
|
360
|
+
<div class="method-source-code" id="M000131-source">
|
358
361
|
<pre>
|
359
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
360
|
-
|
361
|
-
|
362
|
-
|
362
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 73</span>
|
363
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_sequence</span>(<span class="ruby-identifier">linenum</span>=<span class="ruby-keyword kw">nil</span>)
|
364
|
+
<span class="ruby-keyword kw">return</span> []
|
365
|
+
<span class="ruby-keyword kw">end</span>
|
363
366
|
</pre>
|
364
367
|
</div>
|
365
368
|
</div>
|
366
369
|
</div>
|
367
370
|
|
368
|
-
<div id="method-
|
369
|
-
<a name="
|
371
|
+
<div id="method-M000140" class="method-detail">
|
372
|
+
<a name="M000140"></a>
|
370
373
|
|
371
374
|
<div class="method-heading">
|
372
|
-
<a href="#
|
375
|
+
<a href="#M000140" class="method-signature">
|
373
376
|
<span class="method-name">current_line</span><span class="method-args">()</span>
|
374
377
|
</a>
|
375
378
|
</div>
|
376
379
|
|
377
380
|
<div class="method-description">
|
378
381
|
<p><a class="source-toggle" href="#"
|
379
|
-
onclick="toggleCode('
|
380
|
-
<div class="method-source-code" id="
|
382
|
+
onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
|
383
|
+
<div class="method-source-code" id="M000140-source">
|
381
384
|
<pre>
|
382
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
383
|
-
|
384
|
-
|
385
|
-
|
385
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 112</span>
|
386
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_line</span>
|
387
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@line</span>
|
388
|
+
<span class="ruby-keyword kw">end</span>
|
386
389
|
</pre>
|
387
390
|
</div>
|
388
391
|
</div>
|
389
392
|
</div>
|
390
393
|
|
391
|
-
<div id="method-
|
392
|
-
<a name="
|
394
|
+
<div id="method-M000141" class="method-detail">
|
395
|
+
<a name="M000141"></a>
|
393
396
|
|
394
397
|
<div class="method-heading">
|
395
|
-
<a href="#
|
398
|
+
<a href="#M000141" class="method-signature">
|
396
399
|
<span class="method-name">current_linenum</span><span class="method-args">()</span>
|
397
400
|
</a>
|
398
401
|
</div>
|
399
402
|
|
400
403
|
<div class="method-description">
|
401
404
|
<p><a class="source-toggle" href="#"
|
402
|
-
onclick="toggleCode('
|
403
|
-
<div class="method-source-code" id="
|
405
|
+
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
|
406
|
+
<div class="method-source-code" id="M000141-source">
|
404
407
|
<pre>
|
405
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
406
|
-
|
407
|
-
|
408
|
-
|
408
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 116</span>
|
409
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_linenum</span>
|
410
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@linenum</span>
|
411
|
+
<span class="ruby-keyword kw">end</span>
|
409
412
|
</pre>
|
410
413
|
</div>
|
411
414
|
</div>
|
412
415
|
</div>
|
413
416
|
|
414
|
-
<div id="method-
|
415
|
-
<a name="
|
417
|
+
<div id="method-M000138" class="method-detail">
|
418
|
+
<a name="M000138"></a>
|
416
419
|
|
417
420
|
<div class="method-heading">
|
418
|
-
<a href="#
|
421
|
+
<a href="#M000138" class="method-signature">
|
419
422
|
<span class="method-name">merge_map</span><span class="method-args">(map, map2, linenum)</span>
|
420
423
|
</a>
|
421
424
|
</div>
|
422
425
|
|
423
426
|
<div class="method-description">
|
424
427
|
<p><a class="source-toggle" href="#"
|
425
|
-
onclick="toggleCode('
|
426
|
-
<div class="method-source-code" id="
|
428
|
+
onclick="toggleCode('M000138-source');return false;">[Source]</a></p>
|
429
|
+
<div class="method-source-code" id="M000138-source">
|
427
430
|
<pre>
|
428
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
<span class="ruby-keyword kw">end</span>
|
431
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 101</span>
|
432
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge_map</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">map2</span>, <span class="ruby-identifier">linenum</span>)
|
433
|
+
<span class="ruby-identifier">map2</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
434
|
+
<span class="ruby-identifier">map</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">map</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">key</span>)
|
433
435
|
<span class="ruby-keyword kw">end</span>
|
436
|
+
<span class="ruby-keyword kw">end</span>
|
434
437
|
</pre>
|
435
438
|
</div>
|
436
439
|
</div>
|
437
440
|
</div>
|
438
441
|
|
439
|
-
<div id="method-
|
440
|
-
<a name="
|
442
|
+
<div id="method-M000137" class="method-detail">
|
443
|
+
<a name="M000137"></a>
|
441
444
|
|
442
445
|
<div class="method-heading">
|
443
|
-
<a href="#
|
446
|
+
<a href="#M000137" class="method-signature">
|
444
447
|
<span class="method-name">set_default</span><span class="method-args">(map, value, linenum)</span>
|
445
448
|
</a>
|
446
449
|
</div>
|
447
450
|
|
448
451
|
<div class="method-description">
|
449
452
|
<p><a class="source-toggle" href="#"
|
450
|
-
onclick="toggleCode('
|
451
|
-
<div class="method-source-code" id="
|
453
|
+
onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
|
454
|
+
<div class="method-source-code" id="M000137-source">
|
452
455
|
<pre>
|
453
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
454
|
-
|
455
|
-
|
456
|
-
|
456
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 97</span>
|
457
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_default</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>)
|
458
|
+
<span class="ruby-identifier">map</span>.<span class="ruby-identifier">value</span> = <span class="ruby-identifier">value</span>
|
459
|
+
<span class="ruby-keyword kw">end</span>
|
457
460
|
</pre>
|
458
461
|
</div>
|
459
462
|
</div>
|
460
463
|
</div>
|
461
464
|
|
462
|
-
<div id="method-
|
463
|
-
<a name="
|
465
|
+
<div id="method-M000136" class="method-detail">
|
466
|
+
<a name="M000136"></a>
|
464
467
|
|
465
468
|
<div class="method-heading">
|
466
|
-
<a href="#
|
469
|
+
<a href="#M000136" class="method-signature">
|
467
470
|
<span class="method-name">set_map_with</span><span class="method-args">(map, key, value, linenum)</span>
|
468
471
|
</a>
|
469
472
|
</div>
|
470
473
|
|
471
474
|
<div class="method-description">
|
472
475
|
<p><a class="source-toggle" href="#"
|
473
|
-
onclick="toggleCode('
|
474
|
-
<div class="method-source-code" id="
|
476
|
+
onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
|
477
|
+
<div class="method-source-code" id="M000136-source">
|
475
478
|
<pre>
|
476
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
477
|
-
|
478
|
-
|
479
|
-
|
479
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 93</span>
|
480
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_map_with</span>(<span class="ruby-identifier">map</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>)
|
481
|
+
<span class="ruby-identifier">map</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
|
482
|
+
<span class="ruby-keyword kw">end</span>
|
480
483
|
</pre>
|
481
484
|
</div>
|
482
485
|
</div>
|
483
486
|
</div>
|
484
487
|
|
485
|
-
<div id="method-
|
486
|
-
<a name="
|
488
|
+
<div id="method-M000133" class="method-detail">
|
489
|
+
<a name="M000133"></a>
|
487
490
|
|
488
491
|
<div class="method-heading">
|
489
|
-
<a href="#
|
492
|
+
<a href="#M000133" class="method-signature">
|
490
493
|
<span class="method-name">set_seq_at</span><span class="method-args">(seq, i, value, linenum)</span>
|
491
494
|
</a>
|
492
495
|
</div>
|
493
496
|
|
494
497
|
<div class="method-description">
|
495
498
|
<p><a class="source-toggle" href="#"
|
496
|
-
onclick="toggleCode('
|
497
|
-
<div class="method-source-code" id="
|
499
|
+
onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
|
500
|
+
<div class="method-source-code" id="M000133-source">
|
498
501
|
<pre>
|
499
|
-
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line
|
500
|
-
|
501
|
-
|
502
|
-
|
502
|
+
<span class="ruby-comment cmt"># File kwalify/yaml-parser.rb, line 81</span>
|
503
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_seq_at</span>(<span class="ruby-identifier">seq</span>, <span class="ruby-identifier">i</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">linenum</span>)
|
504
|
+
<span class="ruby-identifier">seq</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">value</span>
|
505
|
+
<span class="ruby-keyword kw">end</span>
|
503
506
|
</pre>
|
504
507
|
</div>
|
505
508
|
</div>
|