kwalify 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/CHANGES.txt +15 -4
  2. data/README.txt +8 -10
  3. data/bin/kwalify +1 -1
  4. data/contrib/inline-require +1 -1
  5. data/contrib/kwalify +47 -30
  6. data/doc-api/classes/CommandOptionError.html +1 -1
  7. data/doc-api/classes/Kwalify.html +1 -1
  8. data/doc-api/classes/Kwalify/BaseError.html +1 -1
  9. data/doc-api/classes/Kwalify/Validator.html +4 -1
  10. data/doc-api/classes/Kwalify/Yaml.html +26 -13
  11. data/doc-api/classes/Kwalify/Yaml/Parser.html +17 -17
  12. data/doc-api/created.rid +1 -1
  13. data/doc-api/files/__/README_txt.html +9 -11
  14. data/doc-api/files/kwalify/errors_rb.html +2 -2
  15. data/doc-api/files/kwalify/main_rb.html +1 -1
  16. data/doc-api/files/kwalify/messages_rb.html +2 -2
  17. data/doc-api/files/kwalify/meta-validator_rb.html +1 -1
  18. data/doc-api/files/kwalify/parser/base_rb.html +1 -1
  19. data/doc-api/files/kwalify/parser/yaml_rb.html +2 -2
  20. data/doc-api/files/kwalify/rule_rb.html +1 -1
  21. data/doc-api/files/kwalify/types_rb.html +1 -1
  22. data/doc-api/files/kwalify/util/assert-text-equal_rb.html +1 -1
  23. data/doc-api/files/kwalify/util/hash-interface_rb.html +1 -1
  24. data/doc-api/files/kwalify/util/hashlike_rb.html +1 -1
  25. data/doc-api/files/kwalify/util/option-parser_rb.html +1 -1
  26. data/doc-api/files/kwalify/util/ordered-hash_rb.html +1 -1
  27. data/doc-api/files/kwalify/util/testcase-helper_rb.html +1 -1
  28. data/doc-api/files/kwalify/util_rb.html +1 -1
  29. data/doc-api/files/kwalify/validator_rb.html +2 -2
  30. data/doc-api/files/kwalify/yaml-parser_rb.html +1 -1
  31. data/doc-api/files/kwalify_rb.html +2 -2
  32. data/doc/users-guide.html +20 -15
  33. data/examples/address-book/address-book.schema.yaml +1 -1
  34. data/examples/invoice/invoice.schema.yaml +1 -1
  35. data/examples/tapkit/tapkit.schema.yaml +1 -1
  36. data/lib/kwalify.rb +22 -12
  37. data/lib/kwalify/errors.rb +3 -3
  38. data/lib/kwalify/main.rb +1 -1
  39. data/lib/kwalify/messages.rb +1 -1
  40. data/lib/kwalify/meta-validator.rb +1 -1
  41. data/lib/kwalify/parser/base.rb +1 -1
  42. data/lib/kwalify/parser/yaml.rb +7 -3
  43. data/lib/kwalify/rule.rb +1 -1
  44. data/lib/kwalify/templates/genclass-java.eruby +1 -1
  45. data/lib/kwalify/templates/genclass-php.eruby +1 -1
  46. data/lib/kwalify/templates/genclass-ruby.eruby +1 -1
  47. data/lib/kwalify/types.rb +1 -1
  48. data/lib/kwalify/util.rb +1 -1
  49. data/lib/kwalify/util/assert-text-equal.rb +1 -1
  50. data/lib/kwalify/util/hash-interface.rb +1 -1
  51. data/lib/kwalify/util/hashlike.rb +1 -1
  52. data/lib/kwalify/util/option-parser.rb +1 -1
  53. data/lib/kwalify/util/ordered-hash.rb +1 -1
  54. data/lib/kwalify/util/testcase-helper.rb +1 -1
  55. data/lib/kwalify/validator.rb +5 -2
  56. data/lib/kwalify/yaml-parser.rb +1 -1
  57. data/test/data/users-guide/answers-validator.rb +9 -9
  58. data/test/data/users-guide/howto-validation.rb +2 -2
  59. data/test/data/users-guide/invalid07.result +1 -1
  60. data/test/data/users-guide/loadconfig.rb +2 -1
  61. data/test/data/users-guide/loadconfig.result +5 -1
  62. data/test/test-action.rb +1 -1
  63. data/test/test-action.yaml +1 -1
  64. data/test/test-databinding.rb +6 -3
  65. data/test/test-databinding.yaml +39 -1
  66. data/test/test-main.rb +1 -1
  67. data/test/test-main.yaml +1 -1
  68. data/test/test-metavalidator.rb +1 -1
  69. data/test/test-metavalidator.yaml +1 -1
  70. data/test/test-parser-yaml.rb +1 -1
  71. data/test/test-parser-yaml.yaml +1 -1
  72. data/test/test-rule.rb +1 -1
  73. data/test/test-rule.yaml +1 -1
  74. data/test/test-validator.rb +1 -1
  75. data/test/test-validator.yaml +1 -1
  76. data/test/test-yaml-parser.rb +1 -1
  77. data/test/test-yaml-parser.yaml +1 -1
  78. data/test/test.rb +1 -1
  79. metadata +2 -2
@@ -1 +1 @@
1
- Sun, 27 Jan 2008 22:57:46 +0900
1
+ Mon, 28 Jan 2008 16:57:37 +0900
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Jan 27 22:49:22 +0900 2008</td>
59
+ <td>Mon Jan 28 15:27:13 +0900 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -71,10 +71,10 @@
71
71
  <div id="description">
72
72
  <h1>README</h1>
73
73
  <table>
74
- <tr><td valign="top">release:</td><td>0.7.0
74
+ <tr><td valign="top">release:</td><td>0.7.1
75
75
 
76
76
  </td></tr>
77
- <tr><td valign="top">lastupdate:</td><td>$Date: 2008-01-27 22:49:22 +0900 (Sun, 27 Jan 2008) $
77
+ <tr><td valign="top">lastupdate:</td><td>$Date: 2008-01-28 15:27:12 +0900 (Mon, 28 Jan 2008) $
78
78
 
79
79
  </td></tr>
80
80
  <tr><td valign="top">copyright:</td><td>copyright(c) 2005-2008 kuwata-lab all rights reserved.
@@ -100,18 +100,16 @@ If you have installed RubyGems, just type &#8216;gem install kwalify&#8216;
100
100
  Else if you can be root user, use &#8216;setup.rb&#8217; as following:
101
101
  </p>
102
102
  <pre>
103
- $ tar xjf kwalify_0.7.0.tar.bz2
104
- $ cd kwalify_0.7.0/
105
- $ ruby setup.rb config
106
- $ ruby setup.rb setup
103
+ $ tar xjf kwalify-0.7.1.tar.bz2
104
+ $ cd kwalify-0.7.1/
107
105
  $ sudo ruby setup.rb install
108
106
  </pre>
109
107
  <p>
110
108
  Else copy script and libraries to proper directory.
111
109
  </p>
112
110
  <pre>
113
- $ tar xjf kwalify_0.7.0.tar.bz2
114
- $ cd kwalify_0.7.0/
111
+ $ tar xjf kwalify-0.7.1.tar.bz2
112
+ $ cd kwalify-0.7.1/
115
113
  $ mkdir -p $HOME/bin
116
114
  $ cp -a bin/* $HOME/bin
117
115
  $ export PATH=$PATH:$HOME/bin
@@ -124,8 +122,8 @@ Else copy script and libraries to proper directory.
124
122
  script and libraries into a file.
125
123
  </p>
126
124
  <pre>
127
- $ tar xjf kwalify_0.7.0.tar.bz2
128
- $ cd kwalify_0.7.0/
125
+ $ tar xjf kwalify-0.7.1.tar.bz2
126
+ $ cd kwalify-0.7.1/
129
127
  $ unset RUBYLIB
130
128
  $ ruby contrib/inline-require -I ./lib bin/kwalify &gt; contrib/kwalify
131
129
  $ chmod a+x contrib/kwalify
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Jan 27 13:24:01 +0900 2008</td>
59
+ <td>Mon Jan 28 15:27:13 +0900 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 93 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 99 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 95 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 95 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Jan 27 22:49:22 +0900 2008</td>
59
+ <td>Mon Jan 28 16:57:37 +0900 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 95 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 95 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 95 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 95 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 92 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 92 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Jan 27 13:24:01 +0900 2008</td>
59
+ <td>Mon Jan 28 15:27:13 +0900 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 93 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 99 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 95 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 95 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 87 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 87 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 83 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 83 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 88 $$ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 88 $$ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 89 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 89 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 83 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 83 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 84 $ 0.7.0 $COPYRIGHT$
73
+ $Rev: 84 $ 0.7.1 $COPYRIGHT$
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 83 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 83 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 88 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 88 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sat Jan 26 16:21:33 +0900 2008</td>
59
+ <td>Mon Jan 28 15:27:13 +0900 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 89 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 99 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 81 $ $Release: 0.7.0 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
73
+ $Rev: 81 $ $Release: 0.7.1 $ copyright(c) 2005-2008 kuwata-lab all rights reserved.
74
74
  </p>
75
75
 
76
76
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Sun Jan 27 22:49:22 +0900 2008</td>
59
+ <td>Mon Jan 28 15:27:13 +0900 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- $Rev: 95 $ $Release: 0.7.0 $ copyright(c) 2006 kuwata-lab.com all rights
73
+ $Rev: 99 $ $Release: 0.7.1 $ copyright(c) 2006 kuwata-lab.com all rights
74
74
  reserved.
75
75
  </p>
76
76
 
@@ -15,7 +15,7 @@
15
15
  <div align="left"><h1>Kwalify User's Guide (for Ruby)</h1></div>
16
16
  <div align="left">
17
17
  makoto kuwata &lt;kwa(at)kuwata-lab.com&gt;<br>
18
- last update: $Date: 2008-01-27 22:57:22 +0900 (Sun, 27 Jan 2008) $<br>
18
+ last update: $Date: 2008-01-28 15:27:12 +0900 (Mon, 28 Jan 2008) $<br>
19
19
  </div>
20
20
 
21
21
  <a name="preface"></a>
@@ -931,8 +931,8 @@ errors = validator.validate(document)
931
931
 
932
932
  ## show errors
933
933
  if errors &amp;&amp; !errors.empty?
934
- for err in errors
935
- puts "[#{err.path}] #{err.message}"
934
+ for e in errors
935
+ puts "[#{e.path}] #{e.message}"
936
936
  end
937
937
  end
938
938
  </pre>
@@ -1063,20 +1063,20 @@ end
1063
1063
  ## create validator
1064
1064
  validator = AnswersValidator.new
1065
1065
 
1066
- ## load YAML document
1066
+ ## parse and validate YAML document
1067
1067
  input = ARGF.read()
1068
- document = Kwalify::Yaml.load(input)
1069
- ## or document = YAML.load(input)
1068
+ parser = Kwalify::Yaml::Parser.new(validator)
1069
+ document = parser.parse(input)
1070
1070
 
1071
- ## validate
1072
- errors = validator.validate(document)
1073
- if errors.empty?
1071
+ ## show errors
1072
+ errors = parser.errors()
1073
+ if !errors || errors.empty?
1074
1074
  puts "Valid."
1075
1075
  else
1076
1076
  puts "*** INVALID!"
1077
- errors.each do |error|
1078
- # error.class == Kwalify::ValidationError
1079
- puts " - [#{error.path}] : #{error.message}"
1077
+ for e in errors
1078
+ # e.class == Kwalify::ValidationError
1079
+ puts "#{e.linenum}:#{e.column} [#{e.path}] #{e.message}"
1080
1080
  end
1081
1081
  end
1082
1082
  </pre>
@@ -1115,7 +1115,7 @@ Valid.
1115
1115
  validate</div>
1116
1116
  <pre class="terminal">$ ruby answers-validator.rb document07b.yaml
1117
1117
  *** INVALID!
1118
- - [/answers/1] : reason is required when answer is 'bad'.
1118
+ 4:3 [/answers/1] reason is required when answer is 'bad'.
1119
1119
  </pre>
1120
1120
  <p>You can validate some document by a Validator instance because Validator class and Validator#validate() method are stateless. If you use instance variables in custom validator_hook() method, it becomes to be stateful.
1121
1121
  </p>
@@ -1212,13 +1212,18 @@ validator = Kwalify::Validator.new(schema)
1212
1212
  parser = Kwalify::Yaml::Parser.new(validator)
1213
1213
  <strong>parser.data_binding = true</strong> # enable data binding
1214
1214
  config = parser.parse_file('config.yaml')
1215
- p config
1215
+ require 'pp'
1216
+ pp config
1216
1217
  </pre>
1217
1218
  <a name="loadconfig.result"></a>
1218
1219
  <div class="terminal_caption">
1219
1220
  result</div>
1220
1221
  <pre class="terminal">$ ruby loadconfig.rb
1221
- #&lt;Config:0x542590 @host="localhost", @pass="password1", @port=8080, @user="user1"&gt;
1222
+ #&lt;Config:
1223
+ @host="localhost",
1224
+ @pass="password1",
1225
+ @port=8080,
1226
+ @user="user1"&gt;
1222
1227
  </pre>
1223
1228
  <p>Data binding is available even when data is more complex.
1224
1229
  Preceding alias is also available.
@@ -1,7 +1,7 @@
1
1
  ##
2
2
  ## Kwalify schema example for address book
3
3
  ##
4
- ## $Release: 0.7.0 $
4
+ ## $Release: 0.7.1 $
5
5
  ## copyright(c) 2005-2008 kuwata-lab all rights reserved.
6
6
  ##
7
7
  ##
@@ -2,7 +2,7 @@
2
2
  ### Kwalify schema example for invoice
3
3
  ###
4
4
  ### $Rev: 83 $
5
- ### $Release: 0.7.0 $
5
+ ### $Release: 0.7.1 $
6
6
  ### copyright(c) 2005-2008 kuwata-lab all rights reserved.
7
7
  ###
8
8
 
@@ -1,7 +1,7 @@
1
1
  ##
2
2
  ## Kwalify schema example for TapKit
3
3
  ##
4
- ## $Release: 0.7.0 $
4
+ ## $Release: 0.7.1 $
5
5
  ## copyright(c) 2005-2008 kuwata-lab all rights reserved.
6
6
  ##
7
7
 
@@ -1,13 +1,13 @@
1
1
  ###
2
- ### $Rev: 95 $
3
- ### $Release: 0.7.0 $
2
+ ### $Rev: 99 $
3
+ ### $Release: 0.7.1 $
4
4
  ### copyright(c) 2006 kuwata-lab.com all rights reserved.
5
5
  ###
6
6
 
7
7
 
8
8
  module Kwalify
9
9
 
10
- RELEASE = ("$Release: 0.7.0 $" =~ /[.\d]+/) && $&
10
+ RELEASE = ("$Release: 0.7.1 $" =~ /[.\d]+/) && $&
11
11
 
12
12
  end
13
13
 
@@ -34,19 +34,29 @@ module Kwalify
34
34
 
35
35
  autoload :Parser, 'kwalify/parser/yaml'
36
36
 
37
- def self.load(yaml_str, options={})
37
+ ## read yaml_str, parse it, and return yaml document.
38
+ ##
39
+ ## opts:
40
+ ## ::validator: Kwalify::Validator object
41
+ ## ::preceding_aliass: allow preceding alias if true
42
+ ## ::data_binding: enable data binding if true
43
+ ## ::untabify: expand tab chars if true
44
+ ## ::filename: filename
45
+ def self.load(yaml_str, opts={})
38
46
  #require 'kwalify/parser/yaml'
39
- parser = Kwalify::Yaml::Parser.new
40
- parser.preceding_alias = true if options[:preceding_alias]
41
- parser.data_binding = true if options[:data_binding]
42
- yaml_str = Kwalify::Util.untabify(yaml_str) if options[:untabify]
43
- ydoc = parser.parse(yaml_str, :filename=>options[:filename])
47
+ parser = Kwalify::Yaml::Parser.new(opts[:validator])
48
+ parser.preceding_alias = true if opts[:preceding_alias]
49
+ parser.data_binding = true if opts[:data_binding]
50
+ yaml_str = Kwalify::Util.untabify(yaml_str) if opts[:untabify]
51
+ ydoc = parser.parse(yaml_str, :filename=>opts[:filename])
44
52
  return ydoc
45
53
  end
46
54
 
47
- def self.load_file(filename, options={})
48
- options[:filename] = filename
49
- return self.load(File.read(filename), options)
55
+ ## read file, parse it, and return yaml document.
56
+ ## see Kwalify::Yaml::Parser.load()
57
+ def self.load_file(filename, opts={})
58
+ opts[:filename] = filename
59
+ return self.load(File.read(filename), opts)
50
60
  end
51
61
 
52
62
  end
@@ -1,6 +1,6 @@
1
1
  ###
2
- ### $Rev: 93 $
3
- ### $Release: 0.7.0 $
2
+ ### $Rev: 99 $
3
+ ### $Release: 0.7.1 $
4
4
  ### copyright(c) 2005-2008 kuwata-lab all rights reserved.
5
5
  ###
6
6
 
@@ -22,7 +22,7 @@ module Kwalify
22
22
  class BaseError < KwalifyError
23
23
  def initialize(message="", path=nil, value=nil, rule=nil, error_symbol=nil)
24
24
  super(message)
25
- @path = path
25
+ @path = path.is_a?(Array) ? '/'+path.join('/') : path
26
26
  @rule = rule
27
27
  @value = value
28
28
  @error_symbol = error_symbol