elster 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/{Users/jwebb/src/bigjason/elster/LICENSE → LICENSE} +0 -0
  2. data/{Users/jwebb/src/bigjason/elster/README.md → README.md} +0 -0
  3. data/{Users/jwebb/src/bigjason/elster/Rakefile → Rakefile} +0 -0
  4. data/{Users/jwebb/src/bigjason/elster/lib → lib}/elster.rb +0 -0
  5. data/{Users/jwebb/src/bigjason/elster/lib → lib}/elster/elster_handler.rb +0 -0
  6. data/{Users/jwebb/src/bigjason/elster/lib → lib}/elster/exceptions.rb +0 -0
  7. data/{Users/jwebb/src/bigjason/elster/lib → lib}/elster/streamer.rb +0 -0
  8. data/lib/elster/version.rb +3 -0
  9. data/{Users/jwebb/src/bigjason/elster/test → test}/streamer_test.rb +0 -0
  10. metadata +14 -39
  11. data/Users/jwebb/src/bigjason/elster/Gemfile +0 -4
  12. data/Users/jwebb/src/bigjason/elster/Gemfile.lock +0 -115
  13. data/Users/jwebb/src/bigjason/elster/doc/Elster.html +0 -129
  14. data/Users/jwebb/src/bigjason/elster/doc/Elster/JsonContainerTypeError.html +0 -123
  15. data/Users/jwebb/src/bigjason/elster/doc/Elster/Streamer.html +0 -607
  16. data/Users/jwebb/src/bigjason/elster/doc/_index.html +0 -140
  17. data/Users/jwebb/src/bigjason/elster/doc/class_list.html +0 -53
  18. data/Users/jwebb/src/bigjason/elster/doc/css/common.css +0 -1
  19. data/Users/jwebb/src/bigjason/elster/doc/css/full_list.css +0 -57
  20. data/Users/jwebb/src/bigjason/elster/doc/css/style.css +0 -328
  21. data/Users/jwebb/src/bigjason/elster/doc/file.README.html +0 -118
  22. data/Users/jwebb/src/bigjason/elster/doc/file_list.html +0 -55
  23. data/Users/jwebb/src/bigjason/elster/doc/frames.html +0 -28
  24. data/Users/jwebb/src/bigjason/elster/doc/index.html +0 -118
  25. data/Users/jwebb/src/bigjason/elster/doc/js/app.js +0 -214
  26. data/Users/jwebb/src/bigjason/elster/doc/js/full_list.js +0 -173
  27. data/Users/jwebb/src/bigjason/elster/doc/js/jquery.js +0 -4
  28. data/Users/jwebb/src/bigjason/elster/doc/method_list.html +0 -92
  29. data/Users/jwebb/src/bigjason/elster/doc/top-level-namespace.html +0 -112
  30. data/Users/jwebb/src/bigjason/elster/elster.gemspec +0 -23
  31. data/Users/jwebb/src/bigjason/elster/lib/elster/version.rb +0 -3
  32. data/Users/jwebb/src/bigjason/elster/pkg/elster-0.0.2.gem +0 -0
  33. data/Users/jwebb/src/bigjason/elster/pkg/elster-0.0.3.gem +0 -0
  34. data/Users/jwebb/src/bigjason/elster/pkg/elster-0.0.5.gem +0 -0
  35. data/Users/jwebb/src/bigjason/elster/pkg/elster-0.0.6.gem +0 -0
  36. data/Users/jwebb/src/bigjason/elster/pkg/elster-0.0.7.gem +0 -0
  37. data/Users/jwebb/src/bigjason/elster/pkg/elster-0.0.8.gem +0 -0
@@ -1,607 +0,0 @@
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: Elster::Streamer
8
-
9
- &mdash; Documentation by YARD 0.8.2.1
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" 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 (S)</a> &raquo;
35
- <span class='title'><span class='object_link'><a href="../Elster.html" title="Elster (module)">Elster</a></span></span>
36
- &raquo;
37
- <span class="title">Streamer</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: Elster::Streamer
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">Elster::Streamer</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/elster/streamer.rb</dd>
98
-
99
- </dl>
100
- <div class="clear"></div>
101
-
102
-
103
- <h2>Constant Summary</h2>
104
-
105
-
106
-
107
-
108
-
109
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
110
- <ul class="summary">
111
-
112
- <li class="public ">
113
- <span class="summary_signature">
114
-
115
- <a href="#output-instance_method" title="#output (instance method)">- (Object) <strong>output</strong> </a>
116
-
117
-
118
-
119
- </span>
120
-
121
-
122
-
123
-
124
- <span class="note title readonly">readonly</span>
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute output.</p>
135
- </div></span>
136
-
137
- </li>
138
-
139
-
140
- </ul>
141
-
142
-
143
-
144
-
145
-
146
- <h2>
147
- Instance Method Summary
148
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
149
- </h2>
150
-
151
- <ul class="summary">
152
-
153
- <li class="public ">
154
- <span class="summary_signature">
155
-
156
- <a href="#add-instance_method" title="#add (instance method)">- (Object) <strong>add</strong>(value = nil, &amp;block) </a>
157
-
158
-
159
-
160
- </span>
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
- <span class="summary_desc"><div class='inline'><p>Output an array.</p>
171
- </div></span>
172
-
173
- </li>
174
-
175
-
176
- <li class="public ">
177
- <span class="summary_signature">
178
-
179
- <a href="#close-instance_method" title="#close (instance method)">- (Object) <strong>close</strong>(close_stream = false) </a>
180
-
181
-
182
-
183
- </span>
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
- <span class="summary_desc"><div class='inline'><p>Close the encoding optionally closing the provided output stream.</p>
194
- </div></span>
195
-
196
- </li>
197
-
198
-
199
- <li class="public ">
200
- <span class="summary_signature">
201
-
202
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Streamer) <strong>initialize</strong>(output) </a>
203
-
204
-
205
-
206
- </span>
207
-
208
-
209
- <span class="note title constructor">constructor</span>
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
- <span class="summary_desc"><div class='inline'><p>Create a new instance of Streamer with the specified output stream.</p>
219
- </div></span>
220
-
221
- </li>
222
-
223
-
224
- <li class="public ">
225
- <span class="summary_signature">
226
-
227
- <a href="#key-instance_method" title="#key (instance method)">- (Object) <strong>key</strong>(key, value = nil, &amp;block) </a>
228
-
229
-
230
-
231
- </span>
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
- <span class="summary_desc"><div class='inline'><p>Output an object key value pair.</p>
242
- </div></span>
243
-
244
- </li>
245
-
246
-
247
- </ul>
248
-
249
-
250
- <div id="constructor_details" class="method_details_list">
251
- <h2>Constructor Details</h2>
252
-
253
- <div class="method_details first">
254
- <h3 class="signature first" id="initialize-instance_method">
255
-
256
- - (<tt><span class='object_link'><a href="" title="Elster::Streamer (class)">Streamer</a></span></tt>) <strong>initialize</strong>(output)
257
-
258
-
259
-
260
-
261
-
262
- </h3><div class="docstring">
263
- <div class="discussion">
264
- <p>Create a new instance of Streamer with the specified output stream. The
265
- <code>output</code> must respond to <code>write</code>.</p>
266
-
267
-
268
- </div>
269
- </div>
270
- <div class="tags">
271
-
272
-
273
- </div><table class="source_code">
274
- <tr>
275
- <td>
276
- <pre class="lines">
277
-
278
-
279
- 9
280
- 10
281
- 11
282
- 12
283
- 13
284
- 14</pre>
285
- </td>
286
- <td>
287
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 9</span>
288
-
289
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_output'>output</span><span class='rparen'>)</span>
290
- <span class='ivar'>@output</span> <span class='op'>=</span> <span class='id identifier rubyid_output'>output</span>
291
- <span class='comment'># Some mutable state to make Rich Hickey weep.
292
- </span> <span class='ivar'>@stack</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
293
- <span class='ivar'>@item_count</span> <span class='op'>=</span> <span class='int'>0</span>
294
- <span class='kw'>end</span></pre>
295
- </td>
296
- </tr>
297
- </table>
298
- </div>
299
-
300
- </div>
301
-
302
- <div id="instance_attr_details" class="attr_details">
303
- <h2>Instance Attribute Details</h2>
304
-
305
-
306
- <span id=""></span>
307
- <div class="method_details first">
308
- <h3 class="signature first" id="output-instance_method">
309
-
310
- - (<tt>Object</tt>) <strong>output</strong> <span class="extras">(readonly)</span>
311
-
312
-
313
-
314
-
315
-
316
- </h3><div class="docstring">
317
- <div class="discussion">
318
- <p>Returns the value of attribute output</p>
319
-
320
-
321
- </div>
322
- </div>
323
- <div class="tags">
324
-
325
-
326
- </div><table class="source_code">
327
- <tr>
328
- <td>
329
- <pre class="lines">
330
-
331
-
332
- 5
333
- 6
334
- 7</pre>
335
- </td>
336
- <td>
337
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 5</span>
338
-
339
- <span class='kw'>def</span> <span class='id identifier rubyid_output'>output</span>
340
- <span class='ivar'>@output</span>
341
- <span class='kw'>end</span></pre>
342
- </td>
343
- </tr>
344
- </table>
345
- </div>
346
-
347
- </div>
348
-
349
-
350
- <div id="instance_method_details" class="method_details_list">
351
- <h2>Instance Method Details</h2>
352
-
353
-
354
- <div class="method_details first">
355
- <h3 class="signature first" id="add-instance_method">
356
-
357
- - (<tt>Object</tt>) <strong>add</strong>(value = nil, &amp;block)
358
-
359
-
360
-
361
-
362
-
363
- </h3><div class="docstring">
364
- <div class="discussion">
365
- <p>Output an array. If a block is passes the <code>value</code> will be ignored and a nested value
366
- started.</p>
367
-
368
- <p>Example:</p>
369
-
370
- <p>json.add(1)
371
- json.add(&quot;Ansible&quot;)</p>
372
-
373
- <p>[ 1, &quot;Ansible&quot; ]</p>
374
-
375
- <p>json.add(1)
376
- json.add do
377
- json.set(:name, &quot;Wiggens&quot;)
378
- end</p>
379
-
380
- <p>[ 1, { &quot;name&quot; : &quot;Wiggens&quot; } ]</p>
381
-
382
-
383
- </div>
384
- </div>
385
- <div class="tags">
386
-
387
-
388
- </div><table class="source_code">
389
- <tr>
390
- <td>
391
- <pre class="lines">
392
-
393
-
394
- 88
395
- 89
396
- 90
397
- 91
398
- 92
399
- 93
400
- 94
401
- 95
402
- 96
403
- 97
404
- 98
405
- 99
406
- 100
407
- 101
408
- 102
409
- 103
410
- 104
411
- 105
412
- 106
413
- 107
414
- 108
415
- 109</pre>
416
- </td>
417
- <td>
418
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 88</span>
419
-
420
- <span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
421
- <span class='kw'>if</span> <span class='ivar'>@current_type</span> <span class='op'>==</span> <span class='symbol'>:object</span>
422
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>JsonContainerTypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Attempted to add an array value inside a JSON object.</span><span class='tstring_end'>&quot;</span></span>
423
- <span class='kw'>end</span>
424
-
425
- <span class='kw'>if</span> <span class='ivar'>@item_count</span> <span class='op'>&gt;</span> <span class='int'>0</span>
426
- <span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>,</span><span class='tstring_end'>&quot;</span></span>
427
- <span class='kw'>else</span>
428
- <span class='ivar'>@current_type</span> <span class='op'>=</span> <span class='symbol'>:array</span>
429
- <span class='id identifier rubyid_begin_section'>begin_section</span>
430
- <span class='kw'>end</span>
431
-
432
- <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
433
- <span class='id identifier rubyid_nest_in'>nest_in</span>
434
- <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
435
- <span class='id identifier rubyid_nest_out'>nest_out</span>
436
- <span class='kw'>else</span>
437
- <span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_encode_value'>encode_value</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
438
- <span class='kw'>end</span>
439
-
440
- <span class='ivar'>@item_count</span> <span class='op'>+=</span> <span class='int'>1</span>
441
- <span class='kw'>end</span></pre>
442
- </td>
443
- </tr>
444
- </table>
445
- </div>
446
-
447
- <div class="method_details ">
448
- <h3 class="signature " id="close-instance_method">
449
-
450
- - (<tt>Object</tt>) <strong>close</strong>(close_stream = false)
451
-
452
-
453
-
454
-
455
-
456
- </h3><div class="docstring">
457
- <div class="discussion">
458
- <p>Close the encoding optionally closing the provided output stream.</p>
459
-
460
-
461
- </div>
462
- </div>
463
- <div class="tags">
464
-
465
-
466
- </div><table class="source_code">
467
- <tr>
468
- <td>
469
- <pre class="lines">
470
-
471
-
472
- 17
473
- 18
474
- 19
475
- 20
476
- 21
477
- 22</pre>
478
- </td>
479
- <td>
480
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 17</span>
481
-
482
- <span class='kw'>def</span> <span class='id identifier rubyid_close'>close</span><span class='lparen'>(</span><span class='id identifier rubyid_close_stream'>close_stream</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
483
- <span class='id identifier rubyid_end_section'>end_section</span>
484
- <span class='kw'>if</span> <span class='id identifier rubyid_close_stream'>close_stream</span>
485
- <span class='ivar'>@output</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
486
- <span class='kw'>end</span>
487
- <span class='kw'>end</span></pre>
488
- </td>
489
- </tr>
490
- </table>
491
- </div>
492
-
493
- <div class="method_details ">
494
- <h3 class="signature " id="key-instance_method">
495
-
496
- - (<tt>Object</tt>) <strong>key</strong>(key, value = nil, &amp;block)
497
-
498
-
499
-
500
-
501
-
502
- </h3><div class="docstring">
503
- <div class="discussion">
504
- <p>Output an object key value pair. If a block is passed, the <code>value</code> will be
505
- ignored and a nested object or array can be added.</p>
506
-
507
- <p>Example:</p>
508
-
509
- <p>json.key(:mistake, &quot;HUGE!&quot;)</p>
510
-
511
- <p>{ &quot;mistake&quot; : &quot;HUGE!&quot; }</p>
512
-
513
- <p>json.key(:mistake) do
514
- json.key(:type, &quot;HUGE!&quot;)
515
- end</p>
516
-
517
- <p>{ &quot;mistake&quot; : { &quot;type&quot; : &quot;HUGE!&quot; } }</p>
518
-
519
- <p>json.key(:mistake) do
520
- json.add(&quot;HUGE!&quot;)
521
- end</p>
522
-
523
- <p>{ &quot;mistake&quot; : [ &quot;HUGE!&quot; ] }</p>
524
-
525
-
526
- </div>
527
- </div>
528
- <div class="tags">
529
-
530
-
531
- </div><table class="source_code">
532
- <tr>
533
- <td>
534
- <pre class="lines">
535
-
536
-
537
- 46
538
- 47
539
- 48
540
- 49
541
- 50
542
- 51
543
- 52
544
- 53
545
- 54
546
- 55
547
- 56
548
- 57
549
- 58
550
- 59
551
- 60
552
- 61
553
- 62
554
- 63
555
- 64
556
- 65
557
- 66
558
- 67
559
- 68
560
- 69
561
- 70</pre>
562
- </td>
563
- <td>
564
- <pre class="code"><span class="info file"># File 'lib/elster/streamer.rb', line 46</span>
565
-
566
- <span class='kw'>def</span> <span class='id identifier rubyid_key'>key</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
567
- <span class='kw'>if</span> <span class='ivar'>@current_type</span> <span class='op'>==</span> <span class='symbol'>:array</span>
568
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>JsonContainerTypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Attempted to write an object `key` value inside a JSON array.</span><span class='tstring_end'>&quot;</span></span>
569
- <span class='kw'>end</span>
570
-
571
- <span class='kw'>if</span> <span class='ivar'>@item_count</span> <span class='op'>&gt;</span> <span class='int'>0</span>
572
- <span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>,</span><span class='tstring_end'>&quot;</span></span>
573
- <span class='kw'>else</span>
574
- <span class='ivar'>@current_type</span> <span class='op'>=</span> <span class='symbol'>:object</span>
575
- <span class='id identifier rubyid_begin_section'>begin_section</span>
576
- <span class='kw'>end</span>
577
-
578
- <span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_encode_value'>encode_value</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
579
- <span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span>
580
-
581
- <span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
582
- <span class='id identifier rubyid_nest_in'>nest_in</span>
583
- <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
584
- <span class='id identifier rubyid_nest_out'>nest_out</span>
585
- <span class='kw'>else</span>
586
- <span class='id identifier rubyid_write'>write</span> <span class='id identifier rubyid_encode_value'>encode_value</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
587
- <span class='kw'>end</span>
588
-
589
- <span class='ivar'>@item_count</span> <span class='op'>+=</span> <span class='int'>1</span>
590
- <span class='kw'>end</span></pre>
591
- </td>
592
- </tr>
593
- </table>
594
- </div>
595
-
596
- </div>
597
-
598
- </div>
599
-
600
- <div id="footer">
601
- Generated on Tue Aug 21 21:31:10 2012 by
602
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
603
- 0.8.2.1 (ruby-1.9.3).
604
- </div>
605
-
606
- </body>
607
- </html>