csv2hash 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -5
  3. data/.yardoc/checksums +25 -0
  4. data/.yardoc/object_types +0 -0
  5. data/.yardoc/objects/root.dat +0 -0
  6. data/.yardoc/proxy_types +0 -0
  7. data/CHANGELOG.md +8 -0
  8. data/Gemfile +6 -0
  9. data/Gemfile.lock +15 -1
  10. data/README.md +32 -4
  11. data/UPGRADE.md +2 -0
  12. data/bin/generate_doc +3 -0
  13. data/config/example.csv +10 -0
  14. data/config/rules.yml +7 -0
  15. data/doc/Cell.html +282 -0
  16. data/doc/Csv2hash/Adapter/Abstract.html +215 -0
  17. data/doc/Csv2hash/Adapter/Base/UnsupportedAdapter.html +123 -0
  18. data/doc/Csv2hash/Adapter/Base.html +201 -0
  19. data/doc/Csv2hash/Adapter/CsvAdapter.html +348 -0
  20. data/doc/Csv2hash/Adapter/MemoryAdapter.html +348 -0
  21. data/doc/Csv2hash/Adapter.html +117 -0
  22. data/doc/Csv2hash/DataWrapper.html +500 -0
  23. data/doc/Csv2hash/Definition.html +1008 -0
  24. data/doc/Csv2hash/Discover.html +192 -0
  25. data/doc/Csv2hash/Expectation.html +202 -0
  26. data/doc/Csv2hash/ExtraValidator.html +207 -0
  27. data/doc/Csv2hash/Main.html +1298 -0
  28. data/doc/Csv2hash/Notifier.html +189 -0
  29. data/doc/Csv2hash/Parser/Collection.html +283 -0
  30. data/doc/Csv2hash/Parser/Mapping.html +266 -0
  31. data/doc/Csv2hash/Parser.html +121 -0
  32. data/doc/Csv2hash/StructureValidator/Deprecation.html +215 -0
  33. data/doc/Csv2hash/StructureValidator/MaxColumns.html +327 -0
  34. data/doc/Csv2hash/StructureValidator/MinColumns.html +327 -0
  35. data/doc/Csv2hash/StructureValidator/ValidationError.html +123 -0
  36. data/doc/Csv2hash/StructureValidator/Validator.html +184 -0
  37. data/doc/Csv2hash/StructureValidator.html +311 -0
  38. data/doc/Csv2hash/Validator/Collection.html +217 -0
  39. data/doc/Csv2hash/Validator/Mapping.html +200 -0
  40. data/doc/Csv2hash/Validator.html +295 -0
  41. data/doc/Csv2hash.html +131 -0
  42. data/doc/CsvArray.html +200 -0
  43. data/doc/Registry.html +312 -0
  44. data/doc/_index.html +391 -0
  45. data/doc/class_list.html +54 -0
  46. data/doc/css/common.css +1 -0
  47. data/doc/css/full_list.css +57 -0
  48. data/doc/css/style.css +339 -0
  49. data/doc/file.README.html +499 -0
  50. data/doc/file_list.html +56 -0
  51. data/doc/frames.html +26 -0
  52. data/doc/index.html +499 -0
  53. data/doc/js/app.js +219 -0
  54. data/doc/js/full_list.js +178 -0
  55. data/doc/js/jquery.js +4 -0
  56. data/doc/method_list.html +473 -0
  57. data/doc/top-level-namespace.html +114 -0
  58. data/lib/csv2hash/definition.rb +3 -3
  59. data/lib/csv2hash/version.rb +1 -1
  60. data/lib/csv2hash/yaml_loader.rb +33 -0
  61. data/lib/csv2hash.rb +28 -8
  62. data/spec/csv2hash/yaml_loader_spec.rb +20 -0
  63. data/spec/csv2hash_spec.rb +13 -10
  64. metadata +56 -1
@@ -0,0 +1,189 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Csv2hash::Notifier
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!Csv2hash/Notifier.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (N)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../Csv2hash.html" title="Csv2hash (module)">Csv2hash</a></span></span>
36
+ &raquo;
37
+ <span class="title">Notifier</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Csv2hash::Notifier
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Csv2hash::Notifier</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/csv2hash/notifier.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>
111
+ Instance Method Summary
112
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
113
+ </h2>
114
+
115
+ <ul class="summary">
116
+
117
+ <li class="public ">
118
+ <span class="summary_signature">
119
+
120
+ <a href="#notify-instance_method" title="#notify (instance method)">- (Object) <strong>notify</strong>(response) </a>
121
+
122
+
123
+
124
+ </span>
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'></div></span>
135
+
136
+ </li>
137
+
138
+
139
+ </ul>
140
+
141
+
142
+
143
+
144
+ <div id="instance_method_details" class="method_details_list">
145
+ <h2>Instance Method Details</h2>
146
+
147
+
148
+ <div class="method_details first">
149
+ <h3 class="signature first" id="notify-instance_method">
150
+
151
+ - (<tt>Object</tt>) <strong>notify</strong>(response)
152
+
153
+
154
+
155
+
156
+
157
+ </h3><table class="source_code">
158
+ <tr>
159
+ <td>
160
+ <pre class="lines">
161
+
162
+
163
+ 3
164
+ 4
165
+ 5</pre>
166
+ </td>
167
+ <td>
168
+ <pre class="code"><span class="info file"># File 'lib/csv2hash/notifier.rb', line 3</span>
169
+
170
+ <span class='kw'>def</span> <span class='id identifier rubyid_notify'>notify</span> <span class='id identifier rubyid_response'>response</span>
171
+ <span class='comment'># puts &#39;Csv with errors&#39;
172
+ </span><span class='kw'>end</span></pre>
173
+ </td>
174
+ </tr>
175
+ </table>
176
+ </div>
177
+
178
+ </div>
179
+
180
+ </div>
181
+
182
+ <div id="footer">
183
+ Generated on Fri Aug 29 17:12:26 2014 by
184
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
+ 0.8.7.4 (ruby-2.1.2).
186
+ </div>
187
+
188
+ </body>
189
+ </html>
@@ -0,0 +1,283 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Csv2hash::Parser::Collection
8
+
9
+ &mdash; Documentation by YARD 0.8.7.4
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Csv2hash/Parser/Collection.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Csv2hash.html" title="Csv2hash (module)">Csv2hash</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Parser.html" title="Csv2hash::Parser (module)">Parser</a></span></span>
36
+ &raquo;
37
+ <span class="title">Collection</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: Csv2hash::Parser::Collection
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+ <dt class="r1">Includes:</dt>
79
+ <dd class="r1"><span class='object_link'><a href="../Expectation.html" title="Csv2hash::Expectation (module)">Expectation</a></span>, <span class='object_link'><a href="../Parser.html" title="Csv2hash::Parser (module)">Csv2hash::Parser</a></span></dd>
80
+
81
+
82
+
83
+
84
+
85
+ <dt class="r2 last">Defined in:</dt>
86
+ <dd class="r2 last">lib/csv2hash/parser/collection.rb</dd>
87
+
88
+ </dl>
89
+ <div class="clear"></div>
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <h2>
100
+ Instance Method Summary
101
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
102
+ </h2>
103
+
104
+ <ul class="summary">
105
+
106
+ <li class="public ">
107
+ <span class="summary_signature">
108
+
109
+ <a href="#fill%21-instance_method" title="#fill! (instance method)">- (Object) <strong>fill!</strong> </a>
110
+
111
+
112
+
113
+ </span>
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ <span class="summary_desc"><div class='inline'></div></span>
124
+
125
+ </li>
126
+
127
+
128
+ <li class="public ">
129
+ <span class="summary_signature">
130
+
131
+ <a href="#fill_it-instance_method" title="#fill_it (instance method)">- (Object) <strong>fill_it</strong>(parsed_data, source_data) </a>
132
+
133
+
134
+
135
+ </span>
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <span class="summary_desc"><div class='inline'></div></span>
146
+
147
+ </li>
148
+
149
+
150
+ </ul>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Expectation.html" title="Csv2hash::Expectation (module)">Expectation</a></span></h3>
163
+ <p class="inherited"><span class='object_link'><a href="../Expectation.html#unexpected_line%3F-instance_method" title="Csv2hash::Expectation#unexpected_line? (method)">#unexpected_line?</a></span></p>
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+ <div id="instance_method_details" class="method_details_list">
173
+ <h2>Instance Method Details</h2>
174
+
175
+
176
+ <div class="method_details first">
177
+ <h3 class="signature first" id="fill!-instance_method">
178
+
179
+ - (<tt>Object</tt>) <strong>fill!</strong>
180
+
181
+
182
+
183
+
184
+
185
+ </h3><table class="source_code">
186
+ <tr>
187
+ <td>
188
+ <pre class="lines">
189
+
190
+
191
+ 9
192
+ 10
193
+ 11
194
+ 12
195
+ 13
196
+ 14
197
+ 15
198
+ 16
199
+ 17
200
+ 18
201
+ 19</pre>
202
+ </td>
203
+ <td>
204
+ <pre class="code"><span class="info file"># File 'lib/csv2hash/parser/collection.rb', line 9</span>
205
+
206
+ <span class='kw'>def</span> <span class='id identifier rubyid_fill!'>fill!</span>
207
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data_computed'>data_computed</span><span class='op'>|</span>
208
+ <span class='id identifier rubyid_data_computed'>data_computed</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
209
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_data_source'>data_source</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='op'>|</span>
210
+ <span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_unexpected_line?'>unexpected_line?</span><span class='lparen'>(</span><span class='id identifier rubyid_line'>line</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span>
211
+ <span class='id identifier rubyid_data_computed'>data_computed</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_tap'>tap</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data_parsed'>data_parsed</span><span class='op'>|</span>
212
+ <span class='id identifier rubyid_fill_it'>fill_it</span> <span class='id identifier rubyid_data_parsed'>data_parsed</span><span class='comma'>,</span> <span class='id identifier rubyid_line'>line</span>
213
+ <span class='kw'>end</span>
214
+ <span class='kw'>end</span>
215
+ <span class='kw'>end</span>
216
+ <span class='kw'>end</span></pre>
217
+ </td>
218
+ </tr>
219
+ </table>
220
+ </div>
221
+
222
+ <div class="method_details ">
223
+ <h3 class="signature " id="fill_it-instance_method">
224
+
225
+ - (<tt>Object</tt>) <strong>fill_it</strong>(parsed_data, source_data)
226
+
227
+
228
+
229
+
230
+
231
+ </h3><table class="source_code">
232
+ <tr>
233
+ <td>
234
+ <pre class="lines">
235
+
236
+
237
+ 21
238
+ 22
239
+ 23
240
+ 24
241
+ 25
242
+ 26
243
+ 27
244
+ 28
245
+ 29
246
+ 30
247
+ 31
248
+ 32
249
+ 33</pre>
250
+ </td>
251
+ <td>
252
+ <pre class="code"><span class="info file"># File 'lib/csv2hash/parser/collection.rb', line 21</span>
253
+
254
+ <span class='kw'>def</span> <span class='id identifier rubyid_fill_it'>fill_it</span> <span class='id identifier rubyid_parsed_data'>parsed_data</span><span class='comma'>,</span> <span class='id identifier rubyid_source_data'>source_data</span>
255
+ <span class='id identifier rubyid_definition'>definition</span><span class='period'>.</span><span class='id identifier rubyid_cells'>cells</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_cell'>cell</span><span class='op'>|</span>
256
+ <span class='kw'>if</span> <span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_rules'>rules</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:mappable</span>
257
+ <span class='id identifier rubyid_x'>x</span> <span class='op'>=</span> <span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_rules'>rules</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:position</span>
258
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_nested'>nested</span> <span class='op'>=</span> <span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_rules'>rules</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span> <span class='symbol'>:nested</span><span class='rparen'>)</span>
259
+ <span class='id identifier rubyid_parsed_data'>parsed_data</span><span class='lbracket'>[</span><span class='id identifier rubyid_nested'>nested</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
260
+ <span class='id identifier rubyid_parsed_data'>parsed_data</span><span class='lbracket'>[</span><span class='id identifier rubyid_nested'>nested</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_rules'>rules</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:key</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_source_data'>source_data</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='rbracket'>]</span>
261
+ <span class='kw'>else</span>
262
+ <span class='id identifier rubyid_parsed_data'>parsed_data</span><span class='lbracket'>[</span><span class='id identifier rubyid_cell'>cell</span><span class='period'>.</span><span class='id identifier rubyid_rules'>rules</span><span class='period'>.</span><span class='id identifier rubyid_fetch'>fetch</span><span class='lparen'>(</span><span class='symbol'>:key</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_source_data'>source_data</span><span class='lbracket'>[</span><span class='id identifier rubyid_x'>x</span><span class='rbracket'>]</span>
263
+ <span class='kw'>end</span>
264
+ <span class='kw'>end</span>
265
+ <span class='kw'>end</span>
266
+ <span class='kw'>end</span></pre>
267
+ </td>
268
+ </tr>
269
+ </table>
270
+ </div>
271
+
272
+ </div>
273
+
274
+ </div>
275
+
276
+ <div id="footer">
277
+ Generated on Fri Aug 29 17:12:26 2014 by
278
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
279
+ 0.8.7.4 (ruby-2.1.2).
280
+ </div>
281
+
282
+ </body>
283
+ </html>