kwalify 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +7 -3
- data/README.txt +1 -1
- data/bin/kwalify +1 -1
- data/contrib/inline-require +1 -1
- data/contrib/kwalify +12 -12
- data/doc-api/classes/CommandOptionError.html +1 -1
- data/doc-api/classes/Kwalify.html +2 -2
- data/doc-api/files/__/README_txt.html +1 -1
- data/doc-api/files/kwalify/errors_rb.html +1 -1
- data/doc-api/files/kwalify/main_rb.html +1 -1
- data/doc-api/files/kwalify/messages_rb.html +1 -1
- data/doc-api/files/kwalify/meta-validator_rb.html +1 -1
- data/doc-api/files/kwalify/rule_rb.html +1 -1
- data/doc-api/files/kwalify/types_rb.html +1 -1
- data/doc-api/files/kwalify/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwalify/util/hash-interface_rb.html +1 -1
- data/doc-api/files/kwalify/util/option-parser_rb.html +1 -1
- data/doc-api/files/kwalify/util/testcase-helper_rb.html +1 -1
- data/doc-api/files/kwalify/util/yaml-helper_rb.html +1 -1
- data/doc-api/files/kwalify/validator_rb.html +1 -1
- data/doc-api/files/kwalify/yaml-parser_rb.html +1 -1
- data/doc-api/files/kwalify_rb.html +1 -1
- data/examples/address-book/address-book.schema.yaml +1 -1
- data/examples/invoice/invoice.schema.yaml +1 -1
- data/examples/tapkit/tapkit.schema.yaml +1 -1
- data/lib/kwalify.rb +2 -2
- data/lib/kwalify/errors.rb +1 -1
- data/lib/kwalify/main.rb +1 -1
- data/lib/kwalify/messages.rb +1 -1
- data/lib/kwalify/meta-validator.rb +1 -1
- data/lib/kwalify/rule.rb +1 -1
- data/lib/kwalify/types.rb +1 -1
- data/lib/kwalify/util/assert-text-equal.rb +1 -1
- data/lib/kwalify/util/hash-interface.rb +1 -1
- data/lib/kwalify/util/option-parser.rb +1 -1
- data/lib/kwalify/util/testcase-helper.rb +1 -1
- data/lib/kwalify/util/yaml-helper.rb +1 -1
- data/lib/kwalify/validator.rb +1 -1
- data/lib/kwalify/yaml-parser.rb +34 -9
- data/test/test-main.rb +1 -1
- data/test/test-main.yaml +1 -1
- data/test/test-metavalidator.rb +1 -1
- data/test/test-metavalidator.yaml +1 -1
- data/test/test-rule.rb +1 -1
- data/test/test-rule.yaml +1 -1
- data/test/test-validator.rb +1 -1
- data/test/test-validator.yaml +1 -1
- data/test/test-yamlparser.rb +1 -1
- data/test/test-yamlparser.yaml +12 -1
- data/test/test.rb +1 -1
- metadata +27 -26
data/ChangeLog
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
.=title: ChangeLog
|
2
|
-
.?release: $Release
|
3
|
-
.?lastupdate: $Date:
|
4
|
-
.?version: $Rev:
|
2
|
+
.?release: $Release$
|
3
|
+
.?lastupdate: $Date: 2007-07-27 21:18:20 +0900 (Fri, 27 Jul 2007) $
|
4
|
+
.?version: $Rev: 68 $
|
5
|
+
|
6
|
+
.: release 0.6.1 (2007-07-27)
|
7
|
+
.* bugfix:
|
8
|
+
.- Quoted string in flow style was not parsed correctly.
|
5
9
|
|
6
10
|
.: release 0.6.0 (2006-05-30)
|
7
11
|
.* enhances:
|
data/README.txt
CHANGED
data/bin/kwalify
CHANGED
data/contrib/inline-require
CHANGED
data/contrib/kwalify
CHANGED
@@ -2,28 +2,28 @@
|
|
2
2
|
|
3
3
|
###
|
4
4
|
### $Rev: 48 $
|
5
|
-
### $Release: 0.6.
|
5
|
+
### $Release: 0.6.1 $
|
6
6
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
7
7
|
###
|
8
8
|
|
9
9
|
#--begin of require 'kwalify'
|
10
10
|
###
|
11
11
|
### $Rev: 48 $
|
12
|
-
### $Release: 0.6.
|
12
|
+
### $Release: 0.6.1 $
|
13
13
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
14
14
|
###
|
15
15
|
|
16
16
|
|
17
17
|
module Kwalify
|
18
18
|
|
19
|
-
RELEASE = ("$Release: 0.6.
|
19
|
+
RELEASE = ("$Release: 0.6.1 $" =~ /[.\d]+/) && $&
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
23
|
#--begin of require 'kwalify/types'
|
24
24
|
###
|
25
25
|
### $Rev: 51 $
|
26
|
-
### $Release: 0.6.
|
26
|
+
### $Release: 0.6.1 $
|
27
27
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
28
28
|
###
|
29
29
|
|
@@ -180,7 +180,7 @@ end
|
|
180
180
|
#--begin of require 'kwalify/messages'
|
181
181
|
###
|
182
182
|
### $Rev: 51 $
|
183
|
-
### $Release: 0.6.
|
183
|
+
### $Release: 0.6.1 $
|
184
184
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
185
185
|
###
|
186
186
|
|
@@ -341,7 +341,7 @@ end
|
|
341
341
|
#--begin of require 'kwalify/errors'
|
342
342
|
###
|
343
343
|
### $Rev: 48 $
|
344
|
-
### $Release: 0.6.
|
344
|
+
### $Release: 0.6.1 $
|
345
345
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
346
346
|
###
|
347
347
|
|
@@ -448,7 +448,7 @@ end
|
|
448
448
|
#--begin of require 'kwalify/rule'
|
449
449
|
###
|
450
450
|
### $Rev: 51 $
|
451
|
-
### $Release: 0.6.
|
451
|
+
### $Release: 0.6.1 $
|
452
452
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
453
453
|
###
|
454
454
|
|
@@ -951,7 +951,7 @@ end
|
|
951
951
|
#--begin of require 'kwalify/validator'
|
952
952
|
###
|
953
953
|
### $Rev: 48 $
|
954
|
-
### $Release: 0.6.
|
954
|
+
### $Release: 0.6.1 $
|
955
955
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
956
956
|
###
|
957
957
|
|
@@ -1177,7 +1177,7 @@ end
|
|
1177
1177
|
#--begin of require 'kwalify/meta-validator'
|
1178
1178
|
###
|
1179
1179
|
### $Rev: 51 $
|
1180
|
-
### $Release: 0.6.
|
1180
|
+
### $Release: 0.6.1 $
|
1181
1181
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
1182
1182
|
###
|
1183
1183
|
|
@@ -1534,7 +1534,7 @@ end
|
|
1534
1534
|
#--begin of require 'kwalify/yaml-parser'
|
1535
1535
|
###
|
1536
1536
|
### $Rev: 51 $
|
1537
|
-
### $Release: 0.6.
|
1537
|
+
### $Release: 0.6.1 $
|
1538
1538
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
1539
1539
|
###
|
1540
1540
|
|
@@ -2328,7 +2328,7 @@ end
|
|
2328
2328
|
#--begin of require 'kwalify/main'
|
2329
2329
|
###
|
2330
2330
|
### $Rev: 51 $
|
2331
|
-
### $Release: 0.6.
|
2331
|
+
### $Release: 0.6.1 $
|
2332
2332
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
2333
2333
|
###
|
2334
2334
|
|
@@ -2338,7 +2338,7 @@ require 'erb'
|
|
2338
2338
|
#--begin of require 'kwalify/util/yaml-helper'
|
2339
2339
|
###
|
2340
2340
|
### $Rev: 51 $
|
2341
|
-
### $Release: 0.6.
|
2341
|
+
### $Release: 0.6.1 $
|
2342
2342
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
2343
2343
|
###
|
2344
2344
|
|
@@ -110,7 +110,7 @@
|
|
110
110
|
|
111
111
|
<div id="description">
|
112
112
|
<p>
|
113
|
-
$Rev: 48 $ $Release: 0.6.
|
113
|
+
$Rev: 48 $ $Release: 0.6.1 $ copyright(c) 2005 kuwata-lab all rights reserved.
|
114
114
|
</p>
|
115
115
|
|
116
116
|
</div>
|
@@ -171,7 +171,7 @@ Class <a href="Kwalify/YamlSyntaxError.html" class="link">Kwalify::YamlSyntaxErr
|
|
171
171
|
<tr class="top-aligned-row context-row">
|
172
172
|
<td class="context-item-name">RELEASE</td>
|
173
173
|
<td>=</td>
|
174
|
-
<td class="context-item-value">("$Release: 0.6.
|
174
|
+
<td class="context-item-value">("$Release: 0.6.1 $" =~ /[.\d]+/) && $&</td>
|
175
175
|
</tr>
|
176
176
|
</table>
|
177
177
|
</div>
|
@@ -71,7 +71,7 @@
|
|
71
71
|
<div id="description">
|
72
72
|
<h1>README</h1>
|
73
73
|
<table>
|
74
|
-
<tr><td valign="top">release:</td><td>$Release: 0.6.
|
74
|
+
<tr><td valign="top">release:</td><td>$Release: 0.6.1 $
|
75
75
|
|
76
76
|
</td></tr>
|
77
77
|
<tr><td valign="top">lastupdate:</td><td>$Date: 2006-05-30 13:29:34 +0900 (Tue, 30 May 2006) $
|
data/lib/kwalify.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
###
|
2
2
|
### $Rev: 48 $
|
3
|
-
### $Release: 0.6.
|
3
|
+
### $Release: 0.6.1 $
|
4
4
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
5
5
|
###
|
6
6
|
|
7
7
|
|
8
8
|
module Kwalify
|
9
9
|
|
10
|
-
RELEASE = ("$Release: 0.6.
|
10
|
+
RELEASE = ("$Release: 0.6.1 $" =~ /[.\d]+/) && $&
|
11
11
|
|
12
12
|
end
|
13
13
|
|
data/lib/kwalify/errors.rb
CHANGED
data/lib/kwalify/main.rb
CHANGED
data/lib/kwalify/messages.rb
CHANGED
data/lib/kwalify/rule.rb
CHANGED
data/lib/kwalify/types.rb
CHANGED
data/lib/kwalify/validator.rb
CHANGED
data/lib/kwalify/yaml-parser.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
###
|
2
2
|
### $Rev: 51 $
|
3
|
-
### $Release: 0.6.
|
3
|
+
### $Release: 0.6.1 $
|
4
4
|
### copyright(c) 2005 kuwata-lab all rights reserved.
|
5
5
|
###
|
6
6
|
|
@@ -42,7 +42,7 @@ module Kwalify
|
|
42
42
|
|
43
43
|
def parse()
|
44
44
|
data = parse_child(0)
|
45
|
-
if data
|
45
|
+
if data.nil? && @end_flag == '---'
|
46
46
|
data = parse_child(0)
|
47
47
|
end
|
48
48
|
resolve_aliases(data) unless @aliases.empty?
|
@@ -147,8 +147,8 @@ module Kwalify
|
|
147
147
|
def _getchar
|
148
148
|
@index += 1
|
149
149
|
ch = @sbuf[@index]
|
150
|
-
while ch
|
151
|
-
break if (line = getline())
|
150
|
+
while ch.nil?
|
151
|
+
break if (line = getline()).nil?
|
152
152
|
reset_sbuf(line)
|
153
153
|
@index += 1
|
154
154
|
ch = @sbuf[@index]
|
@@ -238,18 +238,18 @@ module Kwalify
|
|
238
238
|
ch = current_char
|
239
239
|
assert ch == ?] || ch == ?}
|
240
240
|
ch = getchar_or_nl()
|
241
|
-
unless ch == ?\n || ch == ?# || ch
|
241
|
+
unless ch == ?\n || ch == ?# || ch.nil?
|
242
242
|
#* key=:flow_hastail msg="flow style sequence is closed but got '%s'."
|
243
243
|
raise syntax_error(:flow_hastail, [ch.chr])
|
244
244
|
end
|
245
|
-
getline()
|
245
|
+
getline() unless ch.nil?
|
246
246
|
return data
|
247
247
|
end
|
248
248
|
|
249
249
|
def parse_flow(depth)
|
250
250
|
ch = current_char()
|
251
251
|
#ch = getchar()
|
252
|
-
if ch
|
252
|
+
if ch.nil?
|
253
253
|
#* key=:flow_eof msg="found EOF when parsing flow style."
|
254
254
|
rase syntax_error(:flow_eof)
|
255
255
|
end
|
@@ -342,8 +342,33 @@ module Kwalify
|
|
342
342
|
when ?", ?' #"
|
343
343
|
endch = ch
|
344
344
|
s = ''
|
345
|
-
while (ch = _getchar())
|
346
|
-
|
345
|
+
while !(ch = _getchar()).nil? && ch != endch
|
346
|
+
if ch == ?\\
|
347
|
+
ch = _getchar()
|
348
|
+
if ch.nil?
|
349
|
+
#* key=:flow_str_notclosed msg="%s: string not closed."
|
350
|
+
raise syntax_error(:flow_str_notclosed, endch == ?" ? "'\"'" : '"\'"')
|
351
|
+
end
|
352
|
+
if endch == ?"
|
353
|
+
case ch
|
354
|
+
when ?\\ ; s << "\\"
|
355
|
+
when ?" ; s << "\""
|
356
|
+
when ?n ; s << "\n"
|
357
|
+
when ?r ; s << "\r"
|
358
|
+
when ?t ; s << "\t"
|
359
|
+
when ?b ; s << "\b"
|
360
|
+
else ; s << "\\" << ch.chr
|
361
|
+
end
|
362
|
+
elsif endch == ?'
|
363
|
+
case ch
|
364
|
+
when ?\\ ; s << '\\'
|
365
|
+
when ?' ; s << '\''
|
366
|
+
else ; s << '\\' << ch.chr
|
367
|
+
end
|
368
|
+
end
|
369
|
+
else
|
370
|
+
s << ch.chr
|
371
|
+
end
|
347
372
|
end
|
348
373
|
getchar()
|
349
374
|
scalar = s
|
data/test/test-main.rb
CHANGED
data/test/test-main.yaml
CHANGED
data/test/test-metavalidator.rb
CHANGED
data/test/test-rule.rb
CHANGED
data/test/test-rule.yaml
CHANGED
data/test/test-validator.rb
CHANGED
data/test/test-validator.yaml
CHANGED
data/test/test-yamlparser.rb
CHANGED
data/test/test-yamlparser.yaml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
##
|
2
2
|
## $Rev: 50 $
|
3
|
-
## $Release: 0.6.
|
3
|
+
## $Release: 0.6.1 $
|
4
4
|
## copyright(c) 2005 kuwata-lab all rights reserved.
|
5
5
|
##
|
6
6
|
---
|
@@ -493,6 +493,17 @@ input: |
|
|
493
493
|
expected: |
|
494
494
|
##
|
495
495
|
---
|
496
|
+
name: flowscalar1
|
497
|
+
desc: string containing backslash escape
|
498
|
+
#
|
499
|
+
input: |
|
500
|
+
[ {"key1": "\"\\\n"},
|
501
|
+
{'key2': '\'\\\n'} ]
|
502
|
+
#
|
503
|
+
expected: |
|
504
|
+
[{"key1"=>"\"\\\n"}, {"key2"=>"'\\\\n"}]
|
505
|
+
##
|
506
|
+
---
|
496
507
|
name: flowcombination1
|
497
508
|
desc: combination of flow style seq and map
|
498
509
|
#
|
data/test/test.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: kwalify
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.6.
|
7
|
-
date:
|
6
|
+
version: 0.6.1
|
7
|
+
date: 2007-07-27 00:00:00 +09:00
|
8
8
|
summary: a tiny schema validator for YAML document.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -25,38 +25,39 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- kwatch
|
30
31
|
files:
|
31
32
|
- lib/kwalify
|
32
|
-
- lib/kwalify.rb
|
33
33
|
- lib/kwalify/errors.rb
|
34
34
|
- lib/kwalify/main.rb
|
35
35
|
- lib/kwalify/messages.rb
|
36
36
|
- lib/kwalify/meta-validator.rb
|
37
37
|
- lib/kwalify/rule.rb
|
38
38
|
- lib/kwalify/templates
|
39
|
-
- lib/kwalify/types.rb
|
40
|
-
- lib/kwalify/util
|
41
|
-
- lib/kwalify/validator.rb
|
42
|
-
- lib/kwalify/yaml-parser.rb
|
43
39
|
- lib/kwalify/templates/genclass-java.eruby
|
44
40
|
- lib/kwalify/templates/genclass-ruby.eruby
|
41
|
+
- lib/kwalify/types.rb
|
42
|
+
- lib/kwalify/util
|
45
43
|
- lib/kwalify/util/assert-text-equal.rb
|
46
44
|
- lib/kwalify/util/hash-interface.rb
|
47
45
|
- lib/kwalify/util/option-parser.rb
|
48
46
|
- lib/kwalify/util/testcase-helper.rb
|
49
47
|
- lib/kwalify/util/yaml-helper.rb
|
48
|
+
- lib/kwalify/validator.rb
|
49
|
+
- lib/kwalify/yaml-parser.rb
|
50
|
+
- lib/kwalify.rb
|
50
51
|
- bin/kwalify
|
51
52
|
- examples/address-book
|
52
|
-
- examples/invoice
|
53
|
-
- examples/tapkit
|
54
53
|
- examples/address-book/address-book.schema.yaml
|
55
54
|
- examples/address-book/address-book.yaml
|
56
55
|
- examples/address-book/Makefile
|
56
|
+
- examples/invoice
|
57
57
|
- examples/invoice/invoice.schema.yaml
|
58
58
|
- examples/invoice/invoice.yaml
|
59
59
|
- examples/invoice/Makefile
|
60
|
+
- examples/tapkit
|
60
61
|
- examples/tapkit/main.rb
|
61
62
|
- examples/tapkit/Makefile
|
62
63
|
- examples/tapkit/tapkit.schema.yaml
|
@@ -98,20 +99,9 @@ files:
|
|
98
99
|
- contrib/inline-require
|
99
100
|
- contrib/kwalify
|
100
101
|
- doc-api/classes
|
101
|
-
- doc-api/created.rid
|
102
|
-
- doc-api/files
|
103
|
-
- doc-api/fr_class_index.html
|
104
|
-
- doc-api/fr_file_index.html
|
105
|
-
- doc-api/fr_method_index.html
|
106
|
-
- doc-api/index.html
|
107
|
-
- doc-api/rdoc-style.css
|
108
102
|
- doc-api/classes/CommandOptionError.html
|
109
103
|
- doc-api/classes/CommandOptionParser.html
|
110
104
|
- doc-api/classes/Kwalify
|
111
|
-
- doc-api/classes/Kwalify.html
|
112
|
-
- doc-api/classes/Test
|
113
|
-
- doc-api/classes/Test.html
|
114
|
-
- doc-api/classes/YamlHelper.html
|
115
105
|
- doc-api/classes/Kwalify/AssertionError.html
|
116
106
|
- doc-api/classes/Kwalify/BaseError.html
|
117
107
|
- doc-api/classes/Kwalify/CommandOptionError.html
|
@@ -122,6 +112,7 @@ files:
|
|
122
112
|
- doc-api/classes/Kwalify/MetaValidator.html
|
123
113
|
- doc-api/classes/Kwalify/Parser.html
|
124
114
|
- doc-api/classes/Kwalify/PlainYamlParser
|
115
|
+
- doc-api/classes/Kwalify/PlainYamlParser/Alias.html
|
125
116
|
- doc-api/classes/Kwalify/PlainYamlParser.html
|
126
117
|
- doc-api/classes/Kwalify/Rule.html
|
127
118
|
- doc-api/classes/Kwalify/SchemaError.html
|
@@ -130,12 +121,16 @@ files:
|
|
130
121
|
- doc-api/classes/Kwalify/Validator.html
|
131
122
|
- doc-api/classes/Kwalify/YamlParser.html
|
132
123
|
- doc-api/classes/Kwalify/YamlSyntaxError.html
|
133
|
-
- doc-api/classes/Kwalify
|
124
|
+
- doc-api/classes/Kwalify.html
|
125
|
+
- doc-api/classes/Test
|
134
126
|
- doc-api/classes/Test/Unit.html
|
127
|
+
- doc-api/classes/Test.html
|
128
|
+
- doc-api/classes/YamlHelper.html
|
129
|
+
- doc-api/created.rid
|
130
|
+
- doc-api/files
|
135
131
|
- doc-api/files/__
|
136
|
-
- doc-api/files/kwalify
|
137
|
-
- doc-api/files/kwalify_rb.html
|
138
132
|
- doc-api/files/__/README_txt.html
|
133
|
+
- doc-api/files/kwalify
|
139
134
|
- doc-api/files/kwalify/errors_rb.html
|
140
135
|
- doc-api/files/kwalify/main_rb.html
|
141
136
|
- doc-api/files/kwalify/messages_rb.html
|
@@ -143,13 +138,19 @@ files:
|
|
143
138
|
- doc-api/files/kwalify/rule_rb.html
|
144
139
|
- doc-api/files/kwalify/types_rb.html
|
145
140
|
- doc-api/files/kwalify/util
|
146
|
-
- doc-api/files/kwalify/validator_rb.html
|
147
|
-
- doc-api/files/kwalify/yaml-parser_rb.html
|
148
141
|
- doc-api/files/kwalify/util/assert-text-equal_rb.html
|
149
142
|
- doc-api/files/kwalify/util/hash-interface_rb.html
|
150
143
|
- doc-api/files/kwalify/util/option-parser_rb.html
|
151
144
|
- doc-api/files/kwalify/util/testcase-helper_rb.html
|
152
145
|
- doc-api/files/kwalify/util/yaml-helper_rb.html
|
146
|
+
- doc-api/files/kwalify/validator_rb.html
|
147
|
+
- doc-api/files/kwalify/yaml-parser_rb.html
|
148
|
+
- doc-api/files/kwalify_rb.html
|
149
|
+
- doc-api/fr_class_index.html
|
150
|
+
- doc-api/fr_file_index.html
|
151
|
+
- doc-api/fr_method_index.html
|
152
|
+
- doc-api/index.html
|
153
|
+
- doc-api/rdoc-style.css
|
153
154
|
- doc/users-guide.html
|
154
155
|
- doc/docstyle.css
|
155
156
|
- README.txt
|