kwalify 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. data/CHANGES.txt +232 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.txt +16 -19
  4. data/bin/kwalify +3 -3
  5. data/contrib/inline-require +6 -4
  6. data/contrib/kwalify +3719 -2427
  7. data/doc-api/classes/CommandOptionError.html +17 -17
  8. data/doc-api/classes/CommandOptionParser.html +63 -63
  9. data/doc-api/classes/Kwalify.html +29 -7
  10. data/doc-api/classes/Kwalify/AssertionError.html +9 -9
  11. data/doc-api/classes/Kwalify/BaseError.html +72 -71
  12. data/doc-api/classes/Kwalify/BaseParser.html +461 -0
  13. data/doc-api/classes/Kwalify/CommandOptionError.html +11 -11
  14. data/doc-api/classes/Kwalify/ErrorHelper.html +51 -46
  15. data/doc-api/classes/Kwalify/HashInterface.html +13 -135
  16. data/doc-api/classes/Kwalify/Json.html +105 -0
  17. data/doc-api/classes/Kwalify/Main.html +129 -126
  18. data/doc-api/classes/Kwalify/MetaValidator.html +248 -232
  19. data/doc-api/classes/Kwalify/Parser.html +12 -12
  20. data/doc-api/classes/Kwalify/PlainYamlParser.html +166 -163
  21. data/doc-api/classes/Kwalify/PlainYamlParser/Alias.html +11 -11
  22. data/doc-api/classes/Kwalify/Rule.html +152 -130
  23. data/doc-api/classes/Kwalify/SchemaError.html +10 -10
  24. data/doc-api/classes/Kwalify/SyntaxError.html +185 -0
  25. data/doc-api/classes/Kwalify/Types.html +26 -25
  26. data/doc-api/classes/Kwalify/Util.html +389 -0
  27. data/doc-api/classes/Kwalify/Util/HashLike.html +246 -0
  28. data/doc-api/classes/Kwalify/Util/OrderedHash.html +330 -0
  29. data/doc-api/classes/Kwalify/ValidationError.html +10 -10
  30. data/doc-api/classes/Kwalify/Validator.html +153 -86
  31. data/doc-api/classes/Kwalify/Yaml.html +181 -0
  32. data/doc-api/classes/Kwalify/Yaml/Parser.html +1538 -0
  33. data/doc-api/classes/Kwalify/YamlParser.html +190 -183
  34. data/doc-api/classes/Kwalify/YamlSyntaxError.html +8 -57
  35. data/doc-api/created.rid +1 -1
  36. data/doc-api/files/__/README_txt.html +17 -22
  37. data/doc-api/files/kwalify/errors_rb.html +2 -2
  38. data/doc-api/files/kwalify/main_rb.html +4 -3
  39. data/doc-api/files/kwalify/messages_rb.html +2 -2
  40. data/doc-api/files/kwalify/meta-validator_rb.html +3 -3
  41. data/doc-api/files/kwalify/{util/yaml-helper_rb.html → parser/base_rb.html} +8 -6
  42. data/doc-api/files/kwalify/parser/yaml_rb.html +117 -0
  43. data/doc-api/files/kwalify/rule_rb.html +2 -2
  44. data/doc-api/files/kwalify/types_rb.html +2 -2
  45. data/doc-api/files/kwalify/util/assert-text-equal_rb.html +2 -2
  46. data/doc-api/files/kwalify/util/hash-interface_rb.html +9 -2
  47. data/doc-api/files/kwalify/util/hashlike_rb.html +107 -0
  48. data/doc-api/files/kwalify/util/option-parser_rb.html +2 -2
  49. data/doc-api/files/kwalify/util/ordered-hash_rb.html +107 -0
  50. data/doc-api/files/kwalify/util/testcase-helper_rb.html +2 -2
  51. data/doc-api/files/kwalify/util_rb.html +107 -0
  52. data/doc-api/files/kwalify/validator_rb.html +2 -2
  53. data/doc-api/files/kwalify/yaml-parser_rb.html +2 -2
  54. data/doc-api/files/kwalify_rb.html +3 -2
  55. data/doc-api/fr_class_index.html +8 -1
  56. data/doc-api/fr_file_index.html +5 -1
  57. data/doc-api/fr_method_index.html +128 -69
  58. data/doc/img/fig01.png +0 -0
  59. data/doc/users-guide.html +882 -717
  60. data/examples/address-book/address-book.schema.yaml +2 -2
  61. data/examples/data-binding/BABEL.data.yaml +63 -0
  62. data/examples/data-binding/BABEL.schema.yaml +31 -0
  63. data/examples/data-binding/Makefile +8 -0
  64. data/examples/data-binding/Rakefile +13 -0
  65. data/examples/data-binding/main.rb +27 -0
  66. data/examples/invoice/invoice.schema.yaml +3 -3
  67. data/examples/tapkit/tapkit.schema.yaml +2 -2
  68. data/lib/kwalify.rb +41 -4
  69. data/lib/kwalify/errors.rb +118 -96
  70. data/lib/kwalify/kwalify.schema.yaml +58 -0
  71. data/lib/kwalify/main.rb +384 -377
  72. data/lib/kwalify/messages.rb +41 -27
  73. data/lib/kwalify/meta-validator.rb +251 -331
  74. data/lib/kwalify/parser/base.rb +127 -0
  75. data/lib/kwalify/parser/yaml.rb +837 -0
  76. data/lib/kwalify/rule.rb +545 -487
  77. data/lib/kwalify/templates/genclass-java.eruby +189 -162
  78. data/lib/kwalify/templates/genclass-php.eruby +104 -0
  79. data/lib/kwalify/templates/genclass-ruby.eruby +95 -66
  80. data/lib/kwalify/types.rb +107 -106
  81. data/lib/kwalify/util.rb +157 -0
  82. data/lib/kwalify/util/assert-text-equal.rb +33 -31
  83. data/lib/kwalify/util/hash-interface.rb +11 -30
  84. data/lib/kwalify/util/hashlike.rb +51 -0
  85. data/lib/kwalify/util/option-parser.rb +144 -144
  86. data/lib/kwalify/util/ordered-hash.rb +57 -0
  87. data/lib/kwalify/util/testcase-helper.rb +3 -3
  88. data/lib/kwalify/validator.rb +267 -212
  89. data/lib/kwalify/yaml-parser.rb +822 -768
  90. data/setup.rb +861 -607
  91. data/test/Rookbook.yaml +10 -0
  92. data/test/{tmp.dir/Context.java → data/users-guide/AddressBook.java.expected} +11 -11
  93. data/test/data/users-guide/BABEL.data.yaml +24 -0
  94. data/test/data/users-guide/BABEL.schema.yaml +30 -0
  95. data/test/data/users-guide/ExampleAddressBook.java +47 -0
  96. data/test/{tmp.dir/Group.java → data/users-guide/Group.java.expected} +2 -11
  97. data/test/data/users-guide/Person.java.expected +44 -0
  98. data/test/data/users-guide/address_book.rb +52 -0
  99. data/test/data/users-guide/address_book.schema.yaml +28 -0
  100. data/test/data/users-guide/address_book.yaml +27 -0
  101. data/test/data/users-guide/answers-schema.yaml +12 -0
  102. data/test/data/users-guide/answers-validator.rb +52 -0
  103. data/test/data/users-guide/babel_genclass.result +26 -0
  104. data/test/data/users-guide/config.schema.yaml +7 -0
  105. data/test/data/users-guide/config.yaml +4 -0
  106. data/test/{tmp.dir/silent1.document → data/users-guide/document01a.yaml} +0 -0
  107. data/test/data/users-guide/document01b.yaml +3 -0
  108. data/test/data/users-guide/document02a.yaml +4 -0
  109. data/test/data/users-guide/document02b.yaml +4 -0
  110. data/test/data/users-guide/document03a.yaml +6 -0
  111. data/test/data/users-guide/document03b.yaml +6 -0
  112. data/test/data/users-guide/document04a.yaml +9 -0
  113. data/test/data/users-guide/document04b.yaml +9 -0
  114. data/test/data/users-guide/document05a.yaml +11 -0
  115. data/test/data/users-guide/document05b.yaml +12 -0
  116. data/test/data/users-guide/document06a.yaml +15 -0
  117. data/test/data/users-guide/document06b.yaml +16 -0
  118. data/test/data/users-guide/document07a.yaml +9 -0
  119. data/test/data/users-guide/document07b.yaml +7 -0
  120. data/test/data/users-guide/document12a.json +10 -0
  121. data/test/data/users-guide/document12b.json +6 -0
  122. data/test/data/users-guide/document13a.yaml +17 -0
  123. data/test/data/users-guide/document14a.yaml +3 -0
  124. data/test/data/users-guide/document14b.yaml +3 -0
  125. data/test/data/users-guide/document15a.yaml +6 -0
  126. data/test/data/users-guide/document15b.yaml +5 -0
  127. data/test/data/users-guide/example_address_book.rb +10 -0
  128. data/test/data/users-guide/example_address_book_java.result +32 -0
  129. data/test/data/users-guide/example_address_book_ruby.result +31 -0
  130. data/test/data/users-guide/genclass_java.result +4 -0
  131. data/test/data/users-guide/howto-validation-with-parsing.rb +28 -0
  132. data/test/data/users-guide/howto-validation.rb +25 -0
  133. data/test/data/users-guide/howto3.rb +6 -0
  134. data/test/data/users-guide/howto3.result +5 -0
  135. data/test/data/users-guide/howto3.yaml +8 -0
  136. data/test/data/users-guide/howto5_databinding.result +111 -0
  137. data/test/data/users-guide/invalid01.result +3 -0
  138. data/test/data/users-guide/invalid02.result +5 -0
  139. data/test/data/users-guide/invalid03.result +5 -0
  140. data/test/data/users-guide/invalid04.result +4 -0
  141. data/test/data/users-guide/invalid05.result +11 -0
  142. data/test/data/users-guide/invalid06.result +4 -0
  143. data/test/data/users-guide/invalid07.result +3 -0
  144. data/test/data/users-guide/invalid08.result +3 -0
  145. data/test/data/users-guide/invalid12.json +8 -0
  146. data/test/data/users-guide/invalid14.result +4 -0
  147. data/test/data/users-guide/invalid15.result +4 -0
  148. data/test/data/users-guide/loadbabel.rb +27 -0
  149. data/test/data/users-guide/loadconfig.rb +15 -0
  150. data/test/data/users-guide/loadconfig.result +2 -0
  151. data/test/data/users-guide/models.rb +22 -0
  152. data/test/data/users-guide/option_ha.result +6 -0
  153. data/test/data/users-guide/option_ha_genclass_java.result +7 -0
  154. data/test/{tmp.dir/meta1.schema → data/users-guide/schema01.yaml} +0 -0
  155. data/test/data/users-guide/schema02.yaml +12 -0
  156. data/test/data/users-guide/schema03.yaml +9 -0
  157. data/test/data/users-guide/schema04.yaml +20 -0
  158. data/test/data/users-guide/schema05.yaml +29 -0
  159. data/test/data/users-guide/schema06.yaml +11 -0
  160. data/test/data/users-guide/schema12.json +12 -0
  161. data/test/data/users-guide/schema13.yaml +13 -0
  162. data/test/data/users-guide/schema14.yaml +5 -0
  163. data/test/data/users-guide/schema15.yaml +21 -0
  164. data/test/data/users-guide/valid01.result +2 -0
  165. data/test/data/users-guide/valid02.result +2 -0
  166. data/test/data/users-guide/valid03.result +2 -0
  167. data/test/data/users-guide/valid04.result +2 -0
  168. data/test/data/users-guide/valid05.result +2 -0
  169. data/test/data/users-guide/valid06.result +2 -0
  170. data/test/data/users-guide/valid07.result +2 -0
  171. data/test/data/users-guide/valid08.result +2 -0
  172. data/test/data/users-guide/valid12.result +2 -0
  173. data/test/data/users-guide/valid13.result +2 -0
  174. data/test/data/users-guide/valid14.result +2 -0
  175. data/test/data/users-guide/valid15.result +2 -0
  176. data/test/data/users-guide/validate08.rb +37 -0
  177. data/test/test-action.rb +78 -0
  178. data/test/test-action.yaml +738 -0
  179. data/test/test-databinding.rb +80 -0
  180. data/test/test-databinding.yaml +301 -0
  181. data/test/test-main.rb +129 -150
  182. data/test/test-main.yaml +126 -321
  183. data/test/test-metavalidator.rb +47 -47
  184. data/test/test-metavalidator.yaml +77 -21
  185. data/test/test-parser-yaml.rb +57 -0
  186. data/test/test-parser-yaml.yaml +1749 -0
  187. data/test/test-rule.rb +14 -15
  188. data/test/test-rule.yaml +6 -3
  189. data/test/test-users-guide.rb +75 -0
  190. data/test/test-validator.rb +77 -52
  191. data/test/test-validator.yaml +168 -6
  192. data/test/test-yaml-parser.rb +47 -0
  193. data/test/{test-yamlparser.yaml → test-yaml-parser.yaml} +159 -52
  194. data/test/test.rb +37 -21
  195. metadata +136 -37
  196. data/COPYING +0 -340
  197. data/ChangeLog +0 -70
  198. data/doc-api/classes/YamlHelper.html +0 -259
  199. data/lib/kwalify/util/yaml-helper.rb +0 -82
  200. data/test/test-yamlparser.rb +0 -58
  201. data/test/tmp.dir/User.java +0 -43
  202. data/test/tmp.dir/action1.document +0 -18
  203. data/test/tmp.dir/action1.schema +0 -32
  204. data/test/tmp.dir/action2.document +0 -18
  205. data/test/tmp.dir/action2.schema +0 -32
  206. data/test/tmp.dir/emacs.document +0 -6
  207. data/test/tmp.dir/emacs.schema +0 -6
  208. data/test/tmp.dir/meta1.document +0 -0
  209. data/test/tmp.dir/meta2.document +0 -0
  210. data/test/tmp.dir/meta2.schema +0 -3
  211. data/test/tmp.dir/silent1.schema +0 -3
  212. data/test/tmp.dir/silent2.document +0 -7
  213. data/test/tmp.dir/silent2.schema +0 -3
  214. data/test/tmp.dir/stream.invalid +0 -8
  215. data/test/tmp.dir/stream.schema +0 -3
  216. data/test/tmp.dir/stream.valid +0 -8
  217. data/test/tmp.dir/untabify.document +0 -5
  218. data/test/tmp.dir/untabify.schema +0 -10
  219. data/todo.txt +0 -34
@@ -1,21 +1,32 @@
1
1
  ###
2
- ### $Rev: 51 $
3
- ### $Release: 0.6.1 $
4
- ### copyright(c) 2005 kuwata-lab all rights reserved.
2
+ ### $Rev: 90 $
3
+ ### $Release: 0.7.0 $
4
+ ### copyright(c) 2005-2008 kuwata-lab all rights reserved.
5
5
  ###
6
6
 
7
7
  unless defined?(TESTDIR)
8
- TESTDIR = File.dirname(__FILE__)
9
- #libdir = TESTDIR == '.' ? '../lib' : File.dirname(TESTDIR) + "/lib"
10
- libdir = TESTDIR == '.' ? File.expand_path('../lib') : File.dirname(TESTDIR) + "/lib"
11
- $LOAD_PATH << libdir << TESTDIR
8
+ TESTDIR = File.dirname(__FILE__)
9
+ #libdir = TESTDIR == '.' ? '../lib' : File.dirname(TESTDIR) + "/lib"
10
+ libdir = TESTDIR == '.' ? File.expand_path('../lib') : File.dirname(TESTDIR) + "/lib"
11
+ $LOAD_PATH << libdir << TESTDIR
12
12
  end
13
13
 
14
14
 
15
15
  class StringWriter < String
16
- def write(arg)
17
- self << arg
18
- end
16
+ alias write <<
17
+ end
18
+
19
+
20
+ class Hash
21
+ def inspect
22
+ buf = [ '{' ]
23
+ self.keys.sort_by {|k| k.to_s }.each_with_index do |key, i|
24
+ buf << ', ' if i > 0
25
+ buf << key.inspect << '=>' << self[key].inspect
26
+ end
27
+ buf << '}'
28
+ return buf.join
29
+ end
19
30
  end
20
31
 
21
32
 
@@ -23,22 +34,27 @@ require 'test/unit'
23
34
  require 'yaml'
24
35
  require 'pp'
25
36
  require 'kwalify'
37
+ require 'kwalify/util'
26
38
  require 'kwalify/util/assert-text-equal'
27
39
  require 'kwalify/util/testcase-helper'
28
40
 
29
41
 
30
42
  if $0 == __FILE__
31
43
 
32
- require 'test-yamlparser.rb'
33
- require 'test-rule.rb'
34
- require 'test-validator.rb'
35
- require 'test-metavalidator.rb'
36
- require 'test-main.rb'
37
-
38
- #suite = Test::Unit::TestSuite.new()
39
- #suite << ValidatorTest.suite()
40
- #suite << MetaValidatorTest.suite()
41
- #suite << ParserTest.suite()
42
- #Test::Unit::UI::Console::TestRunner.run(suite)
44
+ require 'test-parser-yaml.rb'
45
+ require 'test-yaml-parser.rb'
46
+ require 'test-rule.rb'
47
+ require 'test-validator.rb'
48
+ require 'test-metavalidator.rb'
49
+ require 'test-databinding.rb'
50
+ require 'test-main.rb'
51
+ require 'test-action.rb'
52
+ require 'test-users-guide.rb'
53
+
54
+ #suite = Test::Unit::TestSuite.new()
55
+ #suite << ValidatorTest.suite()
56
+ #suite << MetaValidatorTest.suite()
57
+ #suite << ParserTest.suite()
58
+ #Test::Unit::UI::Console::TestRunner.run(suite)
43
59
 
44
60
  end
metadata CHANGED
@@ -3,15 +3,15 @@ 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.1
7
- date: 2007-07-27 00:00:00 +09:00
8
- summary: a tiny schema validator for YAML document.
6
+ version: 0.7.0
7
+ date: 2008-01-27 00:00:00 +09:00
8
+ summary: a parser, schema validator, and data-binding tool for YAML and JSON.
9
9
  require_paths:
10
10
  - lib
11
11
  email:
12
- homepage: http://www.kuwata-lab.com/kwalify
12
+ homepage: http://www.kuwata-lab.com/kwalify/
13
13
  rubyforge_project:
14
- description: Kwalify is a tiny schema validator for YAML document. It is in fact very poor compared to Relax NG or DTD. I hope you extend/customize Kwalify for your own way.
14
+ description: Kwalify is a parser, schema validator, and data binding tool for YAML and JSON.
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -27,24 +27,31 @@ signing_key:
27
27
  cert_chain:
28
28
  post_install_message:
29
29
  authors:
30
- - kwatch
30
+ - makoto kuwata
31
31
  files:
32
32
  - lib/kwalify
33
33
  - lib/kwalify/errors.rb
34
+ - lib/kwalify/kwalify.schema.yaml
34
35
  - lib/kwalify/main.rb
35
36
  - lib/kwalify/messages.rb
36
37
  - lib/kwalify/meta-validator.rb
38
+ - lib/kwalify/parser
39
+ - lib/kwalify/parser/base.rb
40
+ - lib/kwalify/parser/yaml.rb
37
41
  - lib/kwalify/rule.rb
38
42
  - lib/kwalify/templates
39
43
  - lib/kwalify/templates/genclass-java.eruby
44
+ - lib/kwalify/templates/genclass-php.eruby
40
45
  - lib/kwalify/templates/genclass-ruby.eruby
41
46
  - lib/kwalify/types.rb
42
47
  - lib/kwalify/util
43
48
  - lib/kwalify/util/assert-text-equal.rb
44
49
  - lib/kwalify/util/hash-interface.rb
50
+ - lib/kwalify/util/hashlike.rb
45
51
  - lib/kwalify/util/option-parser.rb
52
+ - lib/kwalify/util/ordered-hash.rb
46
53
  - lib/kwalify/util/testcase-helper.rb
47
- - lib/kwalify/util/yaml-helper.rb
54
+ - lib/kwalify/util.rb
48
55
  - lib/kwalify/validator.rb
49
56
  - lib/kwalify/yaml-parser.rb
50
57
  - lib/kwalify.rb
@@ -53,6 +60,12 @@ files:
53
60
  - examples/address-book/address-book.schema.yaml
54
61
  - examples/address-book/address-book.yaml
55
62
  - examples/address-book/Makefile
63
+ - examples/data-binding
64
+ - examples/data-binding/BABEL.data.yaml
65
+ - examples/data-binding/BABEL.schema.yaml
66
+ - examples/data-binding/main.rb
67
+ - examples/data-binding/Makefile
68
+ - examples/data-binding/Rakefile
56
69
  - examples/invoice
57
70
  - examples/invoice/invoice.schema.yaml
58
71
  - examples/invoice/invoice.yaml
@@ -62,40 +75,112 @@ files:
62
75
  - examples/tapkit/Makefile
63
76
  - examples/tapkit/tapkit.schema.yaml
64
77
  - examples/tapkit/tapkit.yaml
78
+ - test/data
79
+ - test/data/users-guide
80
+ - test/data/users-guide/address_book.rb
81
+ - test/data/users-guide/address_book.schema.yaml
82
+ - test/data/users-guide/address_book.yaml
83
+ - test/data/users-guide/AddressBook.java.expected
84
+ - test/data/users-guide/answers-schema.yaml
85
+ - test/data/users-guide/answers-validator.rb
86
+ - test/data/users-guide/BABEL.data.yaml
87
+ - test/data/users-guide/BABEL.schema.yaml
88
+ - test/data/users-guide/babel_genclass.result
89
+ - test/data/users-guide/config.schema.yaml
90
+ - test/data/users-guide/config.yaml
91
+ - test/data/users-guide/document01a.yaml
92
+ - test/data/users-guide/document01b.yaml
93
+ - test/data/users-guide/document02a.yaml
94
+ - test/data/users-guide/document02b.yaml
95
+ - test/data/users-guide/document03a.yaml
96
+ - test/data/users-guide/document03b.yaml
97
+ - test/data/users-guide/document04a.yaml
98
+ - test/data/users-guide/document04b.yaml
99
+ - test/data/users-guide/document05a.yaml
100
+ - test/data/users-guide/document05b.yaml
101
+ - test/data/users-guide/document06a.yaml
102
+ - test/data/users-guide/document06b.yaml
103
+ - test/data/users-guide/document07a.yaml
104
+ - test/data/users-guide/document07b.yaml
105
+ - test/data/users-guide/document12a.json
106
+ - test/data/users-guide/document12b.json
107
+ - test/data/users-guide/document13a.yaml
108
+ - test/data/users-guide/document14a.yaml
109
+ - test/data/users-guide/document14b.yaml
110
+ - test/data/users-guide/document15a.yaml
111
+ - test/data/users-guide/document15b.yaml
112
+ - test/data/users-guide/example_address_book.rb
113
+ - test/data/users-guide/example_address_book_java.result
114
+ - test/data/users-guide/example_address_book_ruby.result
115
+ - test/data/users-guide/ExampleAddressBook.java
116
+ - test/data/users-guide/genclass_java.result
117
+ - test/data/users-guide/Group.java.expected
118
+ - test/data/users-guide/howto-validation-with-parsing.rb
119
+ - test/data/users-guide/howto-validation.rb
120
+ - test/data/users-guide/howto3.rb
121
+ - test/data/users-guide/howto3.result
122
+ - test/data/users-guide/howto3.yaml
123
+ - test/data/users-guide/howto5_databinding.result
124
+ - test/data/users-guide/invalid01.result
125
+ - test/data/users-guide/invalid02.result
126
+ - test/data/users-guide/invalid03.result
127
+ - test/data/users-guide/invalid04.result
128
+ - test/data/users-guide/invalid05.result
129
+ - test/data/users-guide/invalid06.result
130
+ - test/data/users-guide/invalid07.result
131
+ - test/data/users-guide/invalid08.result
132
+ - test/data/users-guide/invalid12.json
133
+ - test/data/users-guide/invalid14.result
134
+ - test/data/users-guide/invalid15.result
135
+ - test/data/users-guide/loadbabel.rb
136
+ - test/data/users-guide/loadconfig.rb
137
+ - test/data/users-guide/loadconfig.result
138
+ - test/data/users-guide/models.rb
139
+ - test/data/users-guide/option_ha.result
140
+ - test/data/users-guide/option_ha_genclass_java.result
141
+ - test/data/users-guide/Person.java.expected
142
+ - test/data/users-guide/schema01.yaml
143
+ - test/data/users-guide/schema02.yaml
144
+ - test/data/users-guide/schema03.yaml
145
+ - test/data/users-guide/schema04.yaml
146
+ - test/data/users-guide/schema05.yaml
147
+ - test/data/users-guide/schema06.yaml
148
+ - test/data/users-guide/schema12.json
149
+ - test/data/users-guide/schema13.yaml
150
+ - test/data/users-guide/schema14.yaml
151
+ - test/data/users-guide/schema15.yaml
152
+ - test/data/users-guide/valid01.result
153
+ - test/data/users-guide/valid02.result
154
+ - test/data/users-guide/valid03.result
155
+ - test/data/users-guide/valid04.result
156
+ - test/data/users-guide/valid05.result
157
+ - test/data/users-guide/valid06.result
158
+ - test/data/users-guide/valid07.result
159
+ - test/data/users-guide/valid08.result
160
+ - test/data/users-guide/valid12.result
161
+ - test/data/users-guide/valid13.result
162
+ - test/data/users-guide/valid14.result
163
+ - test/data/users-guide/valid15.result
164
+ - test/data/users-guide/validate08.rb
165
+ - test/Rookbook.yaml
166
+ - test/test-action.rb
167
+ - test/test-action.yaml
168
+ - test/test-databinding.rb
169
+ - test/test-databinding.yaml
65
170
  - test/test-main.rb
66
171
  - test/test-main.yaml
67
172
  - test/test-metavalidator.rb
68
173
  - test/test-metavalidator.yaml
174
+ - test/test-parser-yaml.rb
175
+ - test/test-parser-yaml.yaml
69
176
  - test/test-rule.rb
70
177
  - test/test-rule.yaml
178
+ - test/test-users-guide.rb
71
179
  - test/test-validator.rb
72
180
  - test/test-validator.yaml
73
- - test/test-yamlparser.rb
74
- - test/test-yamlparser.yaml
181
+ - test/test-yaml-parser.rb
182
+ - test/test-yaml-parser.yaml
75
183
  - test/test.rb
76
- - test/tmp.dir
77
- - test/tmp.dir/action1.document
78
- - test/tmp.dir/action1.schema
79
- - test/tmp.dir/action2.document
80
- - test/tmp.dir/action2.schema
81
- - test/tmp.dir/Context.java
82
- - test/tmp.dir/emacs.document
83
- - test/tmp.dir/emacs.schema
84
- - test/tmp.dir/Group.java
85
- - test/tmp.dir/meta1.document
86
- - test/tmp.dir/meta1.schema
87
- - test/tmp.dir/meta2.document
88
- - test/tmp.dir/meta2.schema
89
- - test/tmp.dir/silent1.document
90
- - test/tmp.dir/silent1.schema
91
- - test/tmp.dir/silent2.document
92
- - test/tmp.dir/silent2.schema
93
- - test/tmp.dir/stream.invalid
94
- - test/tmp.dir/stream.schema
95
- - test/tmp.dir/stream.valid
96
- - test/tmp.dir/untabify.document
97
- - test/tmp.dir/untabify.schema
98
- - test/tmp.dir/User.java
99
184
  - contrib/inline-require
100
185
  - contrib/kwalify
101
186
  - doc-api/classes
@@ -104,9 +189,11 @@ files:
104
189
  - doc-api/classes/Kwalify
105
190
  - doc-api/classes/Kwalify/AssertionError.html
106
191
  - doc-api/classes/Kwalify/BaseError.html
192
+ - doc-api/classes/Kwalify/BaseParser.html
107
193
  - doc-api/classes/Kwalify/CommandOptionError.html
108
194
  - doc-api/classes/Kwalify/ErrorHelper.html
109
195
  - doc-api/classes/Kwalify/HashInterface.html
196
+ - doc-api/classes/Kwalify/Json.html
110
197
  - doc-api/classes/Kwalify/KwalifyError.html
111
198
  - doc-api/classes/Kwalify/Main.html
112
199
  - doc-api/classes/Kwalify/MetaValidator.html
@@ -116,16 +203,23 @@ files:
116
203
  - doc-api/classes/Kwalify/PlainYamlParser.html
117
204
  - doc-api/classes/Kwalify/Rule.html
118
205
  - doc-api/classes/Kwalify/SchemaError.html
206
+ - doc-api/classes/Kwalify/SyntaxError.html
119
207
  - doc-api/classes/Kwalify/Types.html
208
+ - doc-api/classes/Kwalify/Util
209
+ - doc-api/classes/Kwalify/Util/HashLike.html
210
+ - doc-api/classes/Kwalify/Util/OrderedHash.html
211
+ - doc-api/classes/Kwalify/Util.html
120
212
  - doc-api/classes/Kwalify/ValidationError.html
121
213
  - doc-api/classes/Kwalify/Validator.html
214
+ - doc-api/classes/Kwalify/Yaml
215
+ - doc-api/classes/Kwalify/Yaml/Parser.html
216
+ - doc-api/classes/Kwalify/Yaml.html
122
217
  - doc-api/classes/Kwalify/YamlParser.html
123
218
  - doc-api/classes/Kwalify/YamlSyntaxError.html
124
219
  - doc-api/classes/Kwalify.html
125
220
  - doc-api/classes/Test
126
221
  - doc-api/classes/Test/Unit.html
127
222
  - doc-api/classes/Test.html
128
- - doc-api/classes/YamlHelper.html
129
223
  - doc-api/created.rid
130
224
  - doc-api/files
131
225
  - doc-api/files/__
@@ -135,14 +229,19 @@ files:
135
229
  - doc-api/files/kwalify/main_rb.html
136
230
  - doc-api/files/kwalify/messages_rb.html
137
231
  - doc-api/files/kwalify/meta-validator_rb.html
232
+ - doc-api/files/kwalify/parser
233
+ - doc-api/files/kwalify/parser/base_rb.html
234
+ - doc-api/files/kwalify/parser/yaml_rb.html
138
235
  - doc-api/files/kwalify/rule_rb.html
139
236
  - doc-api/files/kwalify/types_rb.html
140
237
  - doc-api/files/kwalify/util
141
238
  - doc-api/files/kwalify/util/assert-text-equal_rb.html
142
239
  - doc-api/files/kwalify/util/hash-interface_rb.html
240
+ - doc-api/files/kwalify/util/hashlike_rb.html
143
241
  - doc-api/files/kwalify/util/option-parser_rb.html
242
+ - doc-api/files/kwalify/util/ordered-hash_rb.html
144
243
  - doc-api/files/kwalify/util/testcase-helper_rb.html
145
- - doc-api/files/kwalify/util/yaml-helper_rb.html
244
+ - doc-api/files/kwalify/util_rb.html
146
245
  - doc-api/files/kwalify/validator_rb.html
147
246
  - doc-api/files/kwalify/yaml-parser_rb.html
148
247
  - doc-api/files/kwalify_rb.html
@@ -153,11 +252,11 @@ files:
153
252
  - doc-api/rdoc-style.css
154
253
  - doc/users-guide.html
155
254
  - doc/docstyle.css
255
+ - doc/img/fig01.png
156
256
  - README.txt
157
- - ChangeLog
158
- - COPYING
257
+ - CHANGES.txt
258
+ - MIT-LICENSE
159
259
  - setup.rb
160
- - todo.txt
161
260
  test_files:
162
261
  - test/test.rb
163
262
  rdoc_options: []
data/COPYING DELETED
@@ -1,340 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Library General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- <one line to give the program's name and a brief idea of what it does.>
294
- Copyright (C) <year> <name of author>
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License
307
- along with this program; if not, write to the Free Software
308
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
309
-
310
-
311
- Also add information on how to contact you by electronic and paper mail.
312
-
313
- If the program is interactive, make it output a short notice like this
314
- when it starts in an interactive mode:
315
-
316
- Gnomovision version 69, Copyright (C) year name of author
317
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
- This is free software, and you are welcome to redistribute it
319
- under certain conditions; type `show c' for details.
320
-
321
- The hypothetical commands `show w' and `show c' should show the appropriate
322
- parts of the General Public License. Of course, the commands you use may
323
- be called something other than `show w' and `show c'; they could even be
324
- mouse-clicks or menu items--whatever suits your program.
325
-
326
- You should also get your employer (if you work as a programmer) or your
327
- school, if any, to sign a "copyright disclaimer" for the program, if
328
- necessary. Here is a sample; alter the names:
329
-
330
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
-
333
- <signature of Ty Coon>, 1 April 1989
334
- Ty Coon, President of Vice
335
-
336
- This General Public License does not permit incorporating your program into
337
- proprietary programs. If your program is a subroutine library, you may
338
- consider it more useful to permit linking proprietary applications with the
339
- library. If this is what you want to do, use the GNU Library General
340
- Public License instead of this License.