kermit 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -658,7 +658,7 @@ resultant string
658
658
  </div>
659
659
 
660
660
  <div id="footer">
661
- Generated on Sat Aug 18 16:24:08 2012 by
661
+ Generated on Wed Aug 22 19:28:37 2012 by
662
662
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
663
663
  0.8.2.1 (ruby-1.9.2).
664
664
  </div>
@@ -299,21 +299,13 @@ the logger with the correct path of log.txt
299
299
 
300
300
  23
301
301
  24
302
- 25
303
- 26
304
- 27
305
- 28
306
- 29</pre>
302
+ 25</pre>
307
303
  </td>
308
304
  <td>
309
305
  <pre class="code"><span class="info file"># File 'lib/logging.rb', line 23</span>
310
306
 
311
307
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
312
- <span class='kw'>begin</span>
313
- <span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>../log/log.txt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>monthly</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
314
- <span class='kw'>rescue</span>
315
- <span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>./log/log.txt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>monthly</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
316
- <span class='kw'>end</span>
308
+ <span class='ivar'>@logger</span> <span class='op'>||=</span> <span class='const'>Logger</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>log.txt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>monthly</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
317
309
  <span class='kw'>end</span></pre>
318
310
  </td>
319
311
  </tr>
@@ -392,7 +384,7 @@ the logger
392
384
  </div>
393
385
 
394
386
  <div id="footer">
395
- Generated on Sat Aug 18 16:24:07 2012 by
387
+ Generated on Wed Aug 22 19:28:36 2012 by
396
388
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
397
389
  0.8.2.1 (ruby-1.9.2).
398
390
  </div>
@@ -161,7 +161,7 @@ Daniel Machado Fernandez
161
161
  </div>
162
162
 
163
163
  <div id="footer">
164
- Generated on Sat Aug 18 16:24:08 2012 by
164
+ Generated on Wed Aug 22 19:28:36 2012 by
165
165
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
166
166
  0.8.2.1 (ruby-1.9.2).
167
167
  </div>
@@ -308,8 +308,7 @@ Initializes the Random Adapter class with the dao parameters
308
308
  16
309
309
  17
310
310
  18
311
- 19
312
- 20</pre>
311
+ 19</pre>
313
312
  </td>
314
313
  <td>
315
314
  <pre class="code"><span class="info file"># File 'lib/business/adapter/random_adapter.rb', line 15</span>
@@ -317,7 +316,6 @@ Initializes the Random Adapter class with the dao parameters
317
316
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
318
317
 
319
318
  <span class='ivar'>@dao</span> <span class='op'>=</span> <span class='const'>DAO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rpg</span><span class='tstring_end'>'</span></span>
320
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Starting RandomAdapter...</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
321
319
 
322
320
  <span class='kw'>end</span></pre>
323
321
  </td>
@@ -382,6 +380,7 @@ number of the stream
382
380
  <pre class="lines">
383
381
 
384
382
 
383
+ 25
385
384
  26
386
385
  27
387
386
  28
@@ -400,16 +399,17 @@ number of the stream
400
399
  41</pre>
401
400
  </td>
402
401
  <td>
403
- <pre class="code"><span class="info file"># File 'lib/business/adapter/random_adapter.rb', line 26</span>
402
+ <pre class="code"><span class="info file"># File 'lib/business/adapter/random_adapter.rb', line 25</span>
404
403
 
405
404
  <span class='kw'>def</span> <span class='id identifier rubyid_connect_stream'>connect_stream</span> <span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span>
406
405
 
406
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Starting Random adapter</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
407
407
  <span class='id identifier rubyid_random'>random</span> <span class='op'>=</span> <span class='const'>RandomPhraseGenerator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
408
408
  <span class='id identifier rubyid_i'>i</span><span class='op'>=</span><span class='int'>0</span>
409
409
  <span class='kw'>while</span> <span class='kw'>true</span>
410
410
 
411
411
  <span class='id identifier rubyid_persist'>persist</span> <span class='id identifier rubyid_random'>random</span><span class='period'>.</span><span class='id identifier rubyid_generate'>generate</span>
412
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>retrieving...</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
412
+
413
413
  <span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='id identifier rubyid_i'>i</span><span class='op'>+</span><span class='int'>1</span>
414
414
  <span class='kw'>if</span> <span class='id identifier rubyid_i'>i</span><span class='op'>%</span><span class='int'>10</span> <span class='op'>==</span> <span class='int'>0</span>
415
415
  <span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>10</span>
@@ -492,7 +492,7 @@ the status to persist
492
492
  </div>
493
493
 
494
494
  <div id="footer">
495
- Generated on Sat Aug 18 16:24:08 2012 by
495
+ Generated on Wed Aug 22 19:28:37 2012 by
496
496
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
497
497
  0.8.2.1 (ruby-1.9.2).
498
498
  </div>
@@ -313,15 +313,13 @@ the resultant message
313
313
  36
314
314
  37
315
315
  38
316
- 39
317
- 40</pre>
316
+ 39</pre>
318
317
  </td>
319
318
  <td>
320
319
  <pre class="code"><span class="info file"># File 'lib/business/converter/random_converter.rb', line 20</span>
321
320
 
322
321
  <span class='kw'>def</span> <span class='id identifier rubyid_to_usmf'>to_usmf</span> <span class='id identifier rubyid_status'>status</span>
323
322
 
324
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Start the random parse</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
325
323
  <span class='id identifier rubyid_usmf'>usmf</span> <span class='op'>=</span> <span class='const'>USMF</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
326
324
  <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
327
325
 
@@ -336,7 +334,7 @@ the resultant message
336
334
 
337
335
  <span class='id identifier rubyid_usmf'>usmf</span><span class='period'>.</span><span class='id identifier rubyid_links'>links</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
338
336
  <span class='id identifier rubyid_usmf'>usmf</span><span class='period'>.</span><span class='id identifier rubyid_to_users'>to_users</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
339
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Finish the random parse</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
337
+
340
338
  <span class='id identifier rubyid_usmf'>usmf</span>
341
339
 
342
340
  <span class='kw'>end</span></pre>
@@ -350,7 +348,7 @@ the resultant message
350
348
  </div>
351
349
 
352
350
  <div id="footer">
353
- Generated on Sat Aug 18 16:24:08 2012 by
351
+ Generated on Wed Aug 22 19:28:37 2012 by
354
352
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
355
353
  0.8.2.1 (ruby-1.9.2).
356
354
  </div>
@@ -308,7 +308,7 @@ a random phrase
308
308
  </div>
309
309
 
310
310
  <div id="footer">
311
- Generated on Sat Aug 18 16:24:08 2012 by
311
+ Generated on Wed Aug 22 19:28:37 2012 by
312
312
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
313
313
  0.8.2.1 (ruby-1.9.2).
314
314
  </div>
@@ -806,7 +806,7 @@ resultant string
806
806
  </div>
807
807
 
808
808
  <div id="footer">
809
- Generated on Sat Aug 18 16:24:08 2012 by
809
+ Generated on Wed Aug 22 19:28:37 2012 by
810
810
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
811
811
  0.8.2.1 (ruby-1.9.2).
812
812
  </div>
@@ -308,15 +308,13 @@ Configures the dao with the apropiates params
308
308
  18
309
309
  19
310
310
  20
311
- 21
312
- 22</pre>
311
+ 21</pre>
313
312
  </td>
314
313
  <td>
315
314
  <pre class="code"><span class="info file"># File 'lib/business/adapter/twitter_adapter.rb', line 17</span>
316
315
 
317
316
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
318
317
 
319
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Starting TwitterAdapter...</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
320
318
  <span class='ivar'>@dao</span> <span class='op'>=</span> <span class='const'>DAO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>twitter</span><span class='tstring_end'>'</span></span>
321
319
 
322
320
  <span class='kw'>end</span></pre>
@@ -384,6 +382,7 @@ one)
384
382
  <pre class="lines">
385
383
 
386
384
 
385
+ 26
387
386
  27
388
387
  28
389
388
  29
@@ -424,14 +423,15 @@ one)
424
423
  64</pre>
425
424
  </td>
426
425
  <td>
427
- <pre class="code"><span class="info file"># File 'lib/business/adapter/twitter_adapter.rb', line 27</span>
426
+ <pre class="code"><span class="info file"># File 'lib/business/adapter/twitter_adapter.rb', line 26</span>
428
427
 
429
428
  <span class='kw'>def</span> <span class='id identifier rubyid_connect_stream'>connect_stream</span> <span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span>
430
429
 
431
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>retrieving...</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
432
430
  <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>retrieving... </span><span class='tstring_end'>'</span></span>
433
431
  <span class='id identifier rubyid_track'>track</span> <span class='op'>=</span> <span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_twitter'>twitter</span><span class='period'>.</span><span class='id identifier rubyid_track'>track</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>track</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_stream'>stream</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
434
432
 
433
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Starting Twitter adapter #</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_track'>track</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
434
+
435
435
  <span class='const'>EventMachine</span><span class='op'>::</span><span class='id identifier rubyid_run'>run</span> <span class='lbrace'>{</span>
436
436
 
437
437
  <span class='id identifier rubyid_stream'>stream</span> <span class='op'>=</span> <span class='const'>Twitter</span><span class='op'>::</span><span class='const'>JSONStream</span><span class='period'>.</span><span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span>
@@ -541,7 +541,7 @@ tweet retrieved previously
541
541
  </div>
542
542
 
543
543
  <div id="footer">
544
- Generated on Sat Aug 18 16:24:08 2012 by
544
+ Generated on Wed Aug 22 19:28:37 2012 by
545
545
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
546
546
  0.8.2.1 (ruby-1.9.2).
547
547
  </div>
@@ -429,19 +429,13 @@ the resultant message
429
429
  155
430
430
  156
431
431
  157
432
- 158
433
- 159
434
- 160
435
- 161
436
- 162</pre>
432
+ 158</pre>
437
433
  </td>
438
434
  <td>
439
435
  <pre class="code"><span class="info file"># File 'lib/business/converter/twitter_converter.rb', line 22</span>
440
436
 
441
437
  <span class='kw'>def</span> <span class='id identifier rubyid_to_usmf'>to_usmf</span> <span class='id identifier rubyid_status'>status</span>
442
438
 
443
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Starting tweet parse</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
444
-
445
439
  <span class='id identifier rubyid_usmf'>usmf</span> <span class='op'>=</span> <span class='const'>USMF</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
446
440
  <span class='id identifier rubyid_user'>user</span> <span class='op'>=</span> <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
447
441
 
@@ -574,8 +568,6 @@ the resultant message
574
568
 
575
569
  <span class='kw'>end</span>
576
570
 
577
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_debug'>debug</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Finished tweet parse</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
578
-
579
571
  <span class='id identifier rubyid_usmf'>usmf</span>
580
572
 
581
573
  <span class='kw'>end</span></pre>
@@ -589,7 +581,7 @@ the resultant message
589
581
  </div>
590
582
 
591
583
  <div id="footer">
592
- Generated on Sat Aug 18 16:24:08 2012 by
584
+ Generated on Wed Aug 22 19:28:37 2012 by
593
585
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
594
586
  0.8.2.1 (ruby-1.9.2).
595
587
  </div>
@@ -2029,7 +2029,8 @@ resultant hash
2029
2029
  93
2030
2030
  94
2031
2031
  95
2032
- 96</pre>
2032
+ 96
2033
+ 97</pre>
2033
2034
  </td>
2034
2035
  <td>
2035
2036
  <pre class="code"><span class="info file"># File 'lib/model/USMF/USMF.rb', line 29</span>
@@ -2058,18 +2059,6 @@ resultant hash
2058
2059
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>min_rating</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_min_rating'>min_rating</span><span class='comma'>,</span>
2059
2060
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>max_rating</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_max_rating'>max_rating</span>
2060
2061
  <span class='rbrace'>}</span>
2061
- <span class='kw'>begin</span>
2062
-
2063
- <span class='kw'>unless</span> <span class='symbol'>:user</span> <span class='op'>==</span> <span class='kw'>nil</span>
2064
- <span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>user</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span>
2065
- <span class='kw'>end</span>
2066
-
2067
- <span class='kw'>rescue</span>
2068
-
2069
- <span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>user</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span>
2070
- <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>A corrupt user was found</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
2071
-
2072
- <span class='kw'>end</span>
2073
2062
 
2074
2063
  <span class='id identifier rubyid_l'>l</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
2075
2064
 
@@ -2097,7 +2086,20 @@ resultant hash
2097
2086
 
2098
2087
  <span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>to_users</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_tu'>tu</span>
2099
2088
 
2100
- <span class='kw'>end</span>
2089
+ <span class='kw'>end</span>
2090
+
2091
+ <span class='kw'>begin</span>
2092
+
2093
+ <span class='kw'>if</span> <span class='symbol'>:user</span> <span class='op'>!=</span> <span class='kw'>nil</span>
2094
+ <span class='id identifier rubyid_res'>res</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>user</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span>
2095
+ <span class='kw'>end</span>
2096
+
2097
+ <span class='kw'>rescue</span>
2098
+
2099
+ <span class='comment'>#Sometimes a corrupt user was found
2100
+ </span> <span class='id identifier rubyid_res'>res</span> <span class='op'>=</span> <span class='kw'>nil</span>
2101
+
2102
+ <span class='kw'>end</span>
2101
2103
 
2102
2104
  <span class='id identifier rubyid_res'>res</span>
2103
2105
 
@@ -2179,7 +2181,7 @@ resultant string
2179
2181
  </div>
2180
2182
 
2181
2183
  <div id="footer">
2182
- Generated on Sat Aug 18 16:24:08 2012 by
2184
+ Generated on Wed Aug 22 19:28:37 2012 by
2183
2185
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2184
2186
  0.8.2.1 (ruby-1.9.2).
2185
2187
  </div>
@@ -1398,7 +1398,7 @@ resultant string
1398
1398
  </div>
1399
1399
 
1400
1400
  <div id="footer">
1401
- Generated on Sat Aug 18 16:24:08 2012 by
1401
+ Generated on Wed Aug 22 19:28:36 2012 by
1402
1402
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1403
1403
  0.8.2.1 (ruby-1.9.2).
1404
1404
  </div>
@@ -269,13 +269,17 @@ Server
269
269
  32
270
270
  33
271
271
  34
272
- 35</pre>
272
+ 35
273
+ 36
274
+ 37</pre>
273
275
  </td>
274
276
  <td>
275
277
  <pre class="code"><span class="info file"># File 'lib/helper/websocket_client.rb', line 13</span>
276
278
 
277
279
  <span class='kw'>def</span> <span class='id identifier rubyid_start'>start</span>
278
280
 
281
+ <span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_info'>info</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Starting the WebSocket Client...</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
282
+
279
283
  <span class='const'>EventMachine</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span> <span class='kw'>do</span>
280
284
 
281
285
  <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>=</span><span class='tstring_end'>'</span></span><span class='op'>*</span><span class='int'>80</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Connecting to websockets server at ws://</span><span class='embexpr_beg'>#{</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_websocket'>websocket</span><span class='period'>.</span><span class='id identifier rubyid_host'>host</span><span class='rbrace'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_websocket'>websocket</span><span class='period'>.</span><span class='id identifier rubyid_port'>port</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>=</span><span class='tstring_end'>'</span></span><span class='op'>*</span><span class='int'>80</span>
@@ -307,7 +311,7 @@ Server
307
311
  </div>
308
312
 
309
313
  <div id="footer">
310
- Generated on Sat Aug 18 16:24:08 2012 by
314
+ Generated on Wed Aug 22 19:28:37 2012 by
311
315
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
312
316
  0.8.2.1 (ruby-1.9.2).
313
317
  </div>
@@ -418,7 +418,7 @@ messages
418
418
  </div>
419
419
 
420
420
  <div id="footer">
421
- Generated on Sat Aug 18 16:24:08 2012 by
421
+ Generated on Wed Aug 22 19:28:37 2012 by
422
422
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
423
423
  0.8.2.1 (ruby-1.9.2).
424
424
  </div>
@@ -261,7 +261,7 @@
261
261
  </div>
262
262
 
263
263
  <div id="footer">
264
- Generated on Sat Aug 18 16:24:07 2012 by
264
+ Generated on Wed Aug 22 19:28:36 2012 by
265
265
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
266
266
  0.8.2.1 (ruby-1.9.2).
267
267
  </div>
@@ -64,7 +64,7 @@
64
64
  <div id="content"><div id='filecontents'>Copyright (c) 2012 Daniel Machado Fernández<br/><br/>Permission is hereby granted, free of charge, to any person obtaining<br/>a copy of this software and associated documentation files (the<br/>&quot;Software&quot;), to deal in the Software without restriction, including<br/>without limitation the rights to use, copy, modify, merge, publish,<br/>distribute, sublicense, and/or sell copies of the Software, and to<br/>permit persons to whom the Software is furnished to do so, subject to<br/>the following conditions:<br/><br/>The above copyright notice and this permission notice shall be<br/>included in all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,<br/>EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br/>MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br/>NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE<br/>LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION<br/>OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION<br/>WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</div></div>
65
65
 
66
66
  <div id="footer">
67
- Generated on Sat Aug 18 16:24:07 2012 by
67
+ Generated on Wed Aug 22 19:28:36 2012 by
68
68
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
69
69
  0.8.2.1 (ruby-1.9.2).
70
70
  </div>
@@ -70,7 +70,7 @@ It also allows different streams serve under a common way to treat data as a sin
70
70
 
71
71
  <h2>Intro</h2>
72
72
 
73
- <p>kermitpfc-core is based on a series of classes to be used to ensure proper functionality of the social network you want to implement, these classes are Adapter to collect social network statuses, Converter to parse the previous statuses in the USMF model (with their respective classes). To facilitate the publish action of USMF, JSON service is used with the help of the Redis Pub / Sub module (which implements the core, Redis must be installed in server mode).</p>
73
+ <p>Kermitpfc-core is based on a series of classes to be used to ensure proper functionality of the social network you want to implement, these classes are Adapter to collect social network statuses, Converter to parse the previous statuses in the USMF model (with their respective classes). To facilitate the publish action of USMF, JSON service is used with the help of the Redis Pub / Sub module (which implements the core, Redis must be installed in server mode).</p>
74
74
 
75
75
  <h2>How to use</h2>
76
76
 
@@ -109,12 +109,13 @@ It also allows different streams serve under a common way to treat data as a sin
109
109
 
110
110
  <p>or</p>
111
111
 
112
- <pre class="code bash"><code>$ kermit config.yml
112
+ <pre class="code bash"><code>$ kermit
113
+ path: config.yml
113
114
  </code></pre>
114
115
  </div></div>
115
116
 
116
117
  <div id="footer">
117
- Generated on Sat Aug 18 16:24:07 2012 by
118
+ Generated on Wed Aug 22 19:28:36 2012 by
118
119
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
120
  0.8.2.1 (ruby-1.9.2).
120
121
  </div>
@@ -70,7 +70,7 @@ It also allows different streams serve under a common way to treat data as a sin
70
70
 
71
71
  <h2>Intro</h2>
72
72
 
73
- <p>kermitpfc-core is based on a series of classes to be used to ensure proper functionality of the social network you want to implement, these classes are Adapter to collect social network statuses, Converter to parse the previous statuses in the USMF model (with their respective classes). To facilitate the publish action of USMF, JSON service is used with the help of the Redis Pub / Sub module (which implements the core, Redis must be installed in server mode).</p>
73
+ <p>Kermitpfc-core is based on a series of classes to be used to ensure proper functionality of the social network you want to implement, these classes are Adapter to collect social network statuses, Converter to parse the previous statuses in the USMF model (with their respective classes). To facilitate the publish action of USMF, JSON service is used with the help of the Redis Pub / Sub module (which implements the core, Redis must be installed in server mode).</p>
74
74
 
75
75
  <h2>How to use</h2>
76
76
 
@@ -109,12 +109,13 @@ It also allows different streams serve under a common way to treat data as a sin
109
109
 
110
110
  <p>or</p>
111
111
 
112
- <pre class="code bash"><code>$ kermit config.yml
112
+ <pre class="code bash"><code>$ kermit
113
+ path: config.yml
113
114
  </code></pre>
114
115
  </div></div>
115
116
 
116
117
  <div id="footer">
117
- Generated on Sat Aug 18 16:24:07 2012 by
118
+ Generated on Wed Aug 22 19:28:36 2012 by
118
119
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119
120
  0.8.2.1 (ruby-1.9.2).
120
121
  </div>
@@ -129,7 +129,7 @@ WebSocket clients array
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Sat Aug 18 16:24:07 2012 by
132
+ Generated on Wed Aug 22 19:28:36 2012 by
133
133
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
134
  0.8.2.1 (ruby-1.9.2).
135
135
  </div>
@@ -22,48 +22,56 @@ class KermitPFC
22
22
  cleaning_the_house
23
23
 
24
24
  puts 'pooling'
25
-
25
+ Logging::logger.info('Pooling')
26
26
  pool = []
27
27
  pool << Thread.new { initialize_websocket_server }
28
28
 
29
29
  puts 'websocket started'
30
+ Logging::logger.info('WebSocket started')
30
31
 
31
32
  for i in 1..Logging::Settings.twitter.streams
32
33
 
33
34
  puts "adding twitter adapter ##{i}"
35
+ Logging::logger.info("adding twitter adapter ##{i}")
36
+
34
37
  pool << Thread.new { twitter_adapter i }
35
38
  sleep 1
36
39
 
37
40
  end
38
41
 
39
42
  puts 'twitter adapters added'
43
+ Logging::logger.info('twitter adapters added')
40
44
 
41
45
  if Logging::Settings.rpg
42
46
 
43
47
  pool << Thread.new { random_adapter }
44
48
  puts 'random adapter added'
49
+ Logging::logger.info('random adapter added')
45
50
 
46
51
  pool << Thread.new { random_converter }
47
52
  puts 'random converter added'
53
+ Logging::logger.info('random converter added')
48
54
 
49
55
  end
50
56
 
51
57
  pool << Thread.new { twitter_converter }
52
58
  puts 'twitter converter added'
53
-
54
- pool.each do |thread|
55
- thread.join
59
+ Logging::logger.info('twitter converter added')
60
+
61
+ if pool.class != NilClass
62
+ pool.each do |thread|
63
+ thread.join
64
+ end
56
65
  end
57
-
58
66
  rescue Exception => e
59
67
 
60
68
  Logging::logger.error(e)
61
-
62
- pool.each do |thread|
63
- Thread.kill(thread)
64
-
69
+ puts e
70
+ if pool.class != NilClass
71
+ pool.each do |thread|
72
+ Thread.kill(thread)
73
+ end
65
74
  end
66
-
67
75
  end
68
76
 
69
77
  end
@@ -108,24 +116,31 @@ class KermitPFC
108
116
  def twitter_converter
109
117
 
110
118
  dao = DAO.new 'twitter'
111
-
119
+ z = 0
112
120
  while true
113
121
 
122
+ Logging::logger.info "TWEETS: #{z}"
123
+
114
124
  status = dao.get_status
115
- puts 'Status retrieved'
116
125
 
117
126
  while status != nil
118
-
127
+
128
+ puts 'Status retrieved'
119
129
  tc = TwitterConverter.new
120
130
  usmf = tc.to_usmf status
121
-
122
- dao.publish usmf.to_hash.to_json
123
- puts 'Published'
124
-
131
+ json = usmf.to_hash.to_json
132
+
133
+ if json != 'null'
134
+ dao.publish json
135
+ puts 'Published'
136
+ z = z + 1
137
+ end
138
+
125
139
  status = dao.get_status
126
140
 
127
141
  end
128
142
 
143
+
129
144
  puts 'All the statuses were been sent'
130
145
  sleep 2
131
146