ballast 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis-gemfile +15 -0
  4. data/.travis.yml +7 -0
  5. data/.yardopts +1 -0
  6. data/CHANGELOG.md +4 -0
  7. data/Gemfile +21 -0
  8. data/README.md +40 -0
  9. data/Rakefile +28 -0
  10. data/ballast.gemspec +35 -0
  11. data/doc/Ballast/Concerns/Ajax.html +806 -0
  12. data/doc/Ballast/Concerns/Common.html +900 -0
  13. data/doc/Ballast/Concerns/ErrorsHandling.html +283 -0
  14. data/doc/Ballast/Concerns/View.html +664 -0
  15. data/doc/Ballast/Concerns.html +127 -0
  16. data/doc/Ballast/Context.html +417 -0
  17. data/doc/Ballast/Errors/BaseError.html +326 -0
  18. data/doc/Ballast/Errors/InvalidDomain.html +157 -0
  19. data/doc/Ballast/Errors/PerformError.html +157 -0
  20. data/doc/Ballast/Errors/ValidationError.html +157 -0
  21. data/doc/Ballast/Errors.html +125 -0
  22. data/doc/Ballast/Operation.html +1304 -0
  23. data/doc/Ballast/OperationsChain.html +585 -0
  24. data/doc/Ballast/Version.html +189 -0
  25. data/doc/Ballast.html +130 -0
  26. data/doc/_index.html +267 -0
  27. data/doc/class_list.html +54 -0
  28. data/doc/css/common.css +1 -0
  29. data/doc/css/full_list.css +57 -0
  30. data/doc/css/style.css +338 -0
  31. data/doc/file.README.html +115 -0
  32. data/doc/file_list.html +56 -0
  33. data/doc/frames.html +26 -0
  34. data/doc/index.html +115 -0
  35. data/doc/js/app.js +219 -0
  36. data/doc/js/full_list.js +178 -0
  37. data/doc/js/jquery.js +4 -0
  38. data/doc/method_list.html +269 -0
  39. data/doc/top-level-namespace.html +112 -0
  40. data/lib/ballast/concerns/ajax.rb +116 -0
  41. data/lib/ballast/concerns/common.rb +97 -0
  42. data/lib/ballast/concerns/errors_handling.rb +49 -0
  43. data/lib/ballast/concerns/view.rb +63 -0
  44. data/lib/ballast/context.rb +38 -0
  45. data/lib/ballast/errors.rb +34 -0
  46. data/lib/ballast/operation.rb +136 -0
  47. data/lib/ballast/operations_chain.rb +38 -0
  48. data/lib/ballast/version.rb +24 -0
  49. data/lib/ballast.rb +24 -0
  50. data/spec/ballast/concerns/ajax_spec.rb +124 -0
  51. data/spec/ballast/concerns/common_spec.rb +100 -0
  52. data/spec/ballast/concerns/errors_handling_spec.rb +63 -0
  53. data/spec/ballast/concerns/view_spec.rb +107 -0
  54. data/spec/ballast/context_spec.rb +23 -0
  55. data/spec/ballast/errors_spec.rb +16 -0
  56. data/spec/ballast/operation_spec.rb +175 -0
  57. data/spec/ballast/operations_chain_spec.rb +33 -0
  58. data/spec/coverage_helper.rb +19 -0
  59. data/spec/spec_helper.rb +19 -0
  60. metadata +225 -0
@@ -0,0 +1,127 @@
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: Ballast::Concerns
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
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#!" + escape(window.location.href);
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="../Ballast.html" title="Ballast (module)">Ballast</a></span></span>
36
+ &raquo;
37
+ <span class="title">Concerns</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: Ballast::Concerns
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/ballast/concerns/ajax.rb<span class="defines">,<br />
83
+ lib/ballast/concerns/view.rb,<br /> lib/ballast/concerns/common.rb,<br /> lib/ballast/concerns/errors_handling.rb</span>
84
+ </dd>
85
+
86
+ </dl>
87
+ <div class="clear"></div>
88
+
89
+ <h2>Overview</h2><div class="docstring">
90
+ <div class="discussion">
91
+ <p>A set of concerns to address common issues.</p>
92
+
93
+
94
+ </div>
95
+ </div>
96
+ <div class="tags">
97
+
98
+
99
+ </div><h2>Defined Under Namespace</h2>
100
+ <p class="children">
101
+
102
+
103
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Concerns/Ajax.html" title="Ballast::Concerns::Ajax (module)">Ajax</a></span>, <span class='object_link'><a href="Concerns/Common.html" title="Ballast::Concerns::Common (module)">Common</a></span>, <span class='object_link'><a href="Concerns/ErrorsHandling.html" title="Ballast::Concerns::ErrorsHandling (module)">ErrorsHandling</a></span>, <span class='object_link'><a href="Concerns/View.html" title="Ballast::Concerns::View (module)">View</a></span>
104
+
105
+
106
+
107
+
108
+ </p>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ </div>
119
+
120
+ <div id="footer">
121
+ Generated on Wed Dec 25 11:35:22 2013 by
122
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
123
+ 0.8.7.3 (ruby-2.0.0).
124
+ </div>
125
+
126
+ </body>
127
+ </html>
@@ -0,0 +1,417 @@
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: Ballast::Context
8
+
9
+ &mdash; Documentation by YARD 0.8.7.3
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#!" + escape(window.location.href);
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="../Ballast.html" title="Ballast (module)">Ballast</a></span></span>
36
+ &raquo;
37
+ <span class="title">Context</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: Ballast::Context
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">Interactor::Context</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Interactor::Context</li>
82
+
83
+ <li class="next">Ballast::Context</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/ballast/context.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+ <p>A context for an operation. It is basically a Hash with few enhancements, like owner, errors and output support.</p>
107
+
108
+
109
+ </div>
110
+ </div>
111
+ <div class="tags">
112
+
113
+
114
+ </div>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ <h2>
123
+ Class Method Summary
124
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
125
+ </h2>
126
+
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#build-class_method" title="build (class method)">+ (Object) <strong>build</strong>(owner, additional = {}) </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'><p>Builds a new context.</p>
147
+ </div></span>
148
+
149
+ </li>
150
+
151
+
152
+ </ul>
153
+
154
+ <h2>
155
+ Instance Method Summary
156
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
157
+ </h2>
158
+
159
+ <ul class="summary">
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#method_missing-instance_method" title="#method_missing (instance method)">- (Object) <strong>method_missing</strong>(method, *args, &amp;block) </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+ <span class="summary_desc"><div class='inline'><p>Lookups missing methods in the delegatee hash.</p>
179
+ </div></span>
180
+
181
+ </li>
182
+
183
+
184
+ </ul>
185
+
186
+
187
+
188
+ <div id="method_missing_details" class="method_details_list">
189
+ <h2>Dynamic Method Handling</h2>
190
+ <p class="notice this">
191
+ This class handles dynamic methods through the <tt>method_missing</tt> method
192
+
193
+ </p>
194
+
195
+ <div class="method_details first">
196
+ <h3 class="signature first" id="method_missing-instance_method">
197
+
198
+ - (<tt>Object</tt>) <strong>method_missing</strong>(method, *args, &amp;block)
199
+
200
+
201
+
202
+
203
+
204
+ </h3><div class="docstring">
205
+ <div class="discussion">
206
+ <p>Lookups missing methods in the delegatee hash.</p>
207
+
208
+
209
+ </div>
210
+ </div>
211
+ <div class="tags">
212
+ <p class="tag_title">Parameters:</p>
213
+ <ul class="param">
214
+
215
+ <li>
216
+
217
+ <span class='name'>method</span>
218
+
219
+
220
+ <span class='type'>(<tt>Symbol</tt>)</span>
221
+
222
+
223
+
224
+ &mdash;
225
+ <div class='inline'><p>The method to lookup.</p>
226
+ </div>
227
+
228
+ </li>
229
+
230
+ <li>
231
+
232
+ <span class='name'>args</span>
233
+
234
+
235
+ <span class='type'>(<tt>Array</tt>)</span>
236
+
237
+
238
+
239
+ &mdash;
240
+ <div class='inline'><p>The arguments passed to the method. <em>This is ignored.</em></p>
241
+ </div>
242
+
243
+ </li>
244
+
245
+ <li>
246
+
247
+ <span class='name'>block</span>
248
+
249
+
250
+ <span class='type'>(<tt>Proc</tt>)</span>
251
+
252
+
253
+
254
+ &mdash;
255
+ <div class='inline'><p>The block passed to the method. <em>This is ignored.</em></p>
256
+ </div>
257
+
258
+ </li>
259
+
260
+ </ul>
261
+
262
+ <p class="tag_title">Returns:</p>
263
+ <ul class="return">
264
+
265
+ <li>
266
+
267
+
268
+ <span class='type'>(<tt>Object</tt>)</span>
269
+
270
+
271
+
272
+ &mdash;
273
+ <div class='inline'><p>The value for the method, if present.</p>
274
+ </div>
275
+
276
+ </li>
277
+
278
+ </ul>
279
+
280
+ </div><table class="source_code">
281
+ <tr>
282
+ <td>
283
+ <pre class="lines">
284
+
285
+
286
+ 28
287
+ 29
288
+ 30
289
+ 31
290
+ 32
291
+ 33
292
+ 34
293
+ 35
294
+ 36</pre>
295
+ </td>
296
+ <td>
297
+ <pre class="code"><span class="info file"># File 'lib/ballast/context.rb', line 28</span>
298
+
299
+ <span class='kw'>def</span> <span class='id identifier rubyid_method_missing'>method_missing</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
300
+ <span class='id identifier rubyid_object'>object</span> <span class='op'>=</span> <span class='id identifier rubyid___getobj__'>__getobj__</span>
301
+
302
+ <span class='kw'>if</span> <span class='id identifier rubyid_object'>object</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='rbracket'>]</span> <span class='kw'>then</span>
303
+ <span class='id identifier rubyid_object'>object</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='rbracket'>]</span>
304
+ <span class='kw'>else</span>
305
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
306
+ <span class='kw'>end</span>
307
+ <span class='kw'>end</span></pre>
308
+ </td>
309
+ </tr>
310
+ </table>
311
+ </div>
312
+
313
+ </div>
314
+
315
+
316
+ <div id="class_method_details" class="method_details_list">
317
+ <h2>Class Method Details</h2>
318
+
319
+
320
+ <div class="method_details first">
321
+ <h3 class="signature first" id="build-class_method">
322
+
323
+ + (<tt>Object</tt>) <strong>build</strong>(owner, additional = {})
324
+
325
+
326
+
327
+
328
+
329
+ </h3><div class="docstring">
330
+ <div class="discussion">
331
+ <p>Builds a new context.</p>
332
+
333
+
334
+ </div>
335
+ </div>
336
+ <div class="tags">
337
+ <p class="tag_title">Parameters:</p>
338
+ <ul class="param">
339
+
340
+ <li>
341
+
342
+ <span class='name'>owner</span>
343
+
344
+
345
+ <span class='type'>(<tt>Object</tt>)</span>
346
+
347
+
348
+
349
+ &mdash;
350
+ <div class='inline'><p>The owner of this context.</p>
351
+ </div>
352
+
353
+ </li>
354
+
355
+ <li>
356
+
357
+ <span class='name'>additional</span>
358
+
359
+
360
+ <span class='type'>(<tt>Hash</tt>)</span>
361
+
362
+
363
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
364
+
365
+
366
+ &mdash;
367
+ <div class='inline'><p>Additional parameters to include into the context.</p>
368
+ </div>
369
+
370
+ </li>
371
+
372
+ </ul>
373
+
374
+
375
+ </div><table class="source_code">
376
+ <tr>
377
+ <td>
378
+ <pre class="lines">
379
+
380
+
381
+ 13
382
+ 14
383
+ 15
384
+ 16
385
+ 17
386
+ 18
387
+ 19
388
+ 20</pre>
389
+ </td>
390
+ <td>
391
+ <pre class="code"><span class="info file"># File 'lib/ballast/context.rb', line 13</span>
392
+
393
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_build'>build</span><span class='lparen'>(</span><span class='id identifier rubyid_owner'>owner</span><span class='comma'>,</span> <span class='id identifier rubyid_additional'>additional</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
394
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='lbrace'>{</span>
395
+ <span class='label'>owner:</span> <span class='id identifier rubyid_owner'>owner</span><span class='comma'>,</span>
396
+ <span class='label'>errors:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
397
+ <span class='label'>output:</span> <span class='kw'>nil</span><span class='comma'>,</span>
398
+ <span class='label'>response:</span> <span class='const'>HashWithIndifferentAccess</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
399
+ <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_additional'>additional</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ensure_access'>ensure_access</span><span class='lparen'>(</span><span class='symbol'>:indifferent</span><span class='rparen'>)</span><span class='rparen'>)</span>
400
+ <span class='kw'>end</span></pre>
401
+ </td>
402
+ </tr>
403
+ </table>
404
+ </div>
405
+
406
+ </div>
407
+
408
+ </div>
409
+
410
+ <div id="footer">
411
+ Generated on Wed Dec 25 11:35:22 2013 by
412
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
413
+ 0.8.7.3 (ruby-2.0.0).
414
+ </div>
415
+
416
+ </body>
417
+ </html>