kermit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +18 -0
- data/LICENSE.txt +20 -0
- data/README.md +54 -0
- data/Rakefile +31 -0
- data/VERSION +1 -0
- data/bin/kermit +24 -0
- data/config/config.example.yml +24 -0
- data/doc/Adapter.html +533 -0
- data/doc/Converter.html +348 -0
- data/doc/DAO.html +1047 -0
- data/doc/KermitPFC.html +927 -0
- data/doc/Link.html +667 -0
- data/doc/Logging.html +401 -0
- data/doc/Logging/Settings.html +170 -0
- data/doc/RandomAdapter.html +501 -0
- data/doc/RandomConverter.html +359 -0
- data/doc/RandomPhraseGenerator.html +317 -0
- data/doc/ToUser.html +815 -0
- data/doc/TwitterAdapter.html +550 -0
- data/doc/TwitterConverter.html +598 -0
- data/doc/USMF.html +2188 -0
- data/doc/User.html +1407 -0
- data/doc/WebSocketClient.html +316 -0
- data/doc/WebSocketServer.html +427 -0
- data/doc/_index.html +270 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.LICENSE.html +73 -0
- data/doc/file.README.html +123 -0
- data/doc/file_list.html +58 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +123 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +764 -0
- data/doc/top-level-namespace.html +138 -0
- data/lib/business/adapter/adapter.rb +39 -0
- data/lib/business/adapter/random_adapter.rb +50 -0
- data/lib/business/adapter/twitter_adapter.rb +75 -0
- data/lib/business/converter/converter.rb +24 -0
- data/lib/business/converter/random_converter.rb +42 -0
- data/lib/business/converter/twitter_converter.rb +164 -0
- data/lib/business/random_phrase_generator.rb +39 -0
- data/lib/helper/DAO.rb +94 -0
- data/lib/helper/settings.rb +11 -0
- data/lib/helper/websocket_client.rb +37 -0
- data/lib/helper/websocket_server.rb +65 -0
- data/lib/kermitpfc.rb +164 -0
- data/lib/logging.rb +31 -0
- data/lib/model/USMF/USMF.rb +98 -0
- data/lib/model/USMF/link.rb +30 -0
- data/lib/model/USMF/to_user.rb +32 -0
- data/lib/model/USMF/user.rb +41 -0
- data/lib/model/templates/USMF +56 -0
- data/lib/model/templates/atom.xml +74 -0
- data/lib/model/templates/example +59 -0
- data/lib/model/templates/rss.xml +68 -0
- data/lib/model/templates/template +49 -0
- data/lib/model/templates/tweet +116 -0
- data/spec/DAO_spec.rb +64 -0
- data/spec/random_adapter_spec.rb +24 -0
- data/spec/random_converter_spec.rb +115 -0
- data/spec/random_phrase_generator_spec.rb +15 -0
- data/spec/twitter_adapter_spec.rb +24 -0
- data/spec/twitter_converter_spec.rb +132 -0
- data/websocket_client.html +20 -0
- metadata +253 -0
data/doc/KermitPFC.html
ADDED
@@ -0,0 +1,927 @@
|
|
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: KermitPFC
|
8
|
+
|
9
|
+
— 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 (K)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">KermitPFC</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: KermitPFC
|
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">KermitPFC</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/kermitpfc.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
<p>
|
105
|
+
Masterclass that adapts the rakefile into a class to use the commander gem
|
106
|
+
</p>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="tags">
|
112
|
+
|
113
|
+
|
114
|
+
<p class="tag_title">See Also:</p>
|
115
|
+
<ul class="see">
|
116
|
+
|
117
|
+
<li><a href="http://rubydoc.info/gems/commander/4.1.2/frames" target="_parent" title="http://rubydoc.info/gems/commander/4.1.2/frames">http://rubydoc.info/gems/commander/4.1.2/frames</a></li>
|
118
|
+
|
119
|
+
</ul>
|
120
|
+
<p class="tag_title">Author:</p>
|
121
|
+
<ul class="author">
|
122
|
+
|
123
|
+
<li>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<div class='inline'><p>
|
130
|
+
Daniel Machado Fernandez
|
131
|
+
</p>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
</li>
|
135
|
+
|
136
|
+
</ul>
|
137
|
+
<p class="tag_title">Version:</p>
|
138
|
+
<ul class="version">
|
139
|
+
|
140
|
+
<li>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<div class='inline'><p>
|
147
|
+
1.0
|
148
|
+
</p>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
</li>
|
152
|
+
|
153
|
+
</ul>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<h2>
|
164
|
+
Instance Method Summary
|
165
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
166
|
+
</h2>
|
167
|
+
|
168
|
+
<ul class="summary">
|
169
|
+
|
170
|
+
<li class="public ">
|
171
|
+
<span class="summary_signature">
|
172
|
+
|
173
|
+
<a href="#cleaning_the_house-instance_method" title="#cleaning_the_house (instance method)">- (Object) <strong>cleaning_the_house</strong> </a>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
</span>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
<span class="summary_desc"><div class='inline'><p>
|
188
|
+
Deletes the db keys previously used.
|
189
|
+
</p>
|
190
|
+
</div></span>
|
191
|
+
|
192
|
+
</li>
|
193
|
+
|
194
|
+
|
195
|
+
<li class="public ">
|
196
|
+
<span class="summary_signature">
|
197
|
+
|
198
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (KermitPFC) <strong>initialize</strong> </a>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
</span>
|
203
|
+
|
204
|
+
|
205
|
+
<span class="note title constructor">constructor</span>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
<span class="summary_desc"><div class='inline'><p>
|
215
|
+
Load the config file.
|
216
|
+
</p>
|
217
|
+
</div></span>
|
218
|
+
|
219
|
+
</li>
|
220
|
+
|
221
|
+
|
222
|
+
<li class="public ">
|
223
|
+
<span class="summary_signature">
|
224
|
+
|
225
|
+
<a href="#initialize_websocket_server-instance_method" title="#initialize_websocket_server (instance method)">- (Object) <strong>initialize_websocket_server</strong> </a>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
</span>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
<span class="summary_desc"><div class='inline'><p>
|
240
|
+
Starts the WebSocket Server.
|
241
|
+
</p>
|
242
|
+
</div></span>
|
243
|
+
|
244
|
+
</li>
|
245
|
+
|
246
|
+
|
247
|
+
<li class="public ">
|
248
|
+
<span class="summary_signature">
|
249
|
+
|
250
|
+
<a href="#random_adapter-instance_method" title="#random_adapter (instance method)">- (Object) <strong>random_adapter</strong>(stream = 1) </a>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
</span>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
<span class="summary_desc"><div class='inline'><p>
|
265
|
+
Starts the Random Adapter.
|
266
|
+
</p>
|
267
|
+
</div></span>
|
268
|
+
|
269
|
+
</li>
|
270
|
+
|
271
|
+
|
272
|
+
<li class="public ">
|
273
|
+
<span class="summary_signature">
|
274
|
+
|
275
|
+
<a href="#random_converter-instance_method" title="#random_converter (instance method)">- (Object) <strong>random_converter</strong> </a>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
</span>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<span class="summary_desc"><div class='inline'><p>
|
290
|
+
Starts the Random Converter.
|
291
|
+
</p>
|
292
|
+
</div></span>
|
293
|
+
|
294
|
+
</li>
|
295
|
+
|
296
|
+
|
297
|
+
<li class="public ">
|
298
|
+
<span class="summary_signature">
|
299
|
+
|
300
|
+
<a href="#twitter_adapter-instance_method" title="#twitter_adapter (instance method)">- (Object) <strong>twitter_adapter</strong>(stream) </a>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
</span>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
<span class="summary_desc"><div class='inline'><p>
|
315
|
+
Starts the Twitter Adapter.
|
316
|
+
</p>
|
317
|
+
</div></span>
|
318
|
+
|
319
|
+
</li>
|
320
|
+
|
321
|
+
|
322
|
+
<li class="public ">
|
323
|
+
<span class="summary_signature">
|
324
|
+
|
325
|
+
<a href="#twitter_converter-instance_method" title="#twitter_converter (instance method)">- (Object) <strong>twitter_converter</strong> </a>
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
</span>
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
<span class="summary_desc"><div class='inline'><p>
|
340
|
+
Starts the Twitter Converter.
|
341
|
+
</p>
|
342
|
+
</div></span>
|
343
|
+
|
344
|
+
</li>
|
345
|
+
|
346
|
+
|
347
|
+
</ul>
|
348
|
+
|
349
|
+
|
350
|
+
<div id="constructor_details" class="method_details_list">
|
351
|
+
<h2>Constructor Details</h2>
|
352
|
+
|
353
|
+
<div class="method_details first">
|
354
|
+
<h3 class="signature first" id="initialize-instance_method">
|
355
|
+
|
356
|
+
- (<tt><span class='object_link'><a href="" title="KermitPFC (class)">KermitPFC</a></span></tt>) <strong>initialize</strong>
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
</h3><div class="docstring">
|
363
|
+
<div class="discussion">
|
364
|
+
<p>
|
365
|
+
Load the config file
|
366
|
+
</p>
|
367
|
+
|
368
|
+
|
369
|
+
</div>
|
370
|
+
</div>
|
371
|
+
<div class="tags">
|
372
|
+
|
373
|
+
|
374
|
+
</div><table class="source_code">
|
375
|
+
<tr>
|
376
|
+
<td>
|
377
|
+
<pre class="lines">
|
378
|
+
|
379
|
+
|
380
|
+
18
|
381
|
+
19
|
382
|
+
20
|
383
|
+
21
|
384
|
+
22
|
385
|
+
23
|
386
|
+
24
|
387
|
+
25
|
388
|
+
26
|
389
|
+
27
|
390
|
+
28
|
391
|
+
29
|
392
|
+
30
|
393
|
+
31
|
394
|
+
32
|
395
|
+
33
|
396
|
+
34
|
397
|
+
35
|
398
|
+
36
|
399
|
+
37
|
400
|
+
38
|
401
|
+
39
|
402
|
+
40
|
403
|
+
41
|
404
|
+
42
|
405
|
+
43
|
406
|
+
44
|
407
|
+
45
|
408
|
+
46
|
409
|
+
47
|
410
|
+
48
|
411
|
+
49
|
412
|
+
50
|
413
|
+
51
|
414
|
+
52
|
415
|
+
53
|
416
|
+
54
|
417
|
+
55
|
418
|
+
56
|
419
|
+
57
|
420
|
+
58
|
421
|
+
59
|
422
|
+
60
|
423
|
+
61
|
424
|
+
62
|
425
|
+
63
|
426
|
+
64
|
427
|
+
65
|
428
|
+
66
|
429
|
+
67
|
430
|
+
68
|
431
|
+
69</pre>
|
432
|
+
</td>
|
433
|
+
<td>
|
434
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 18</span>
|
435
|
+
|
436
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
437
|
+
|
438
|
+
<span class='kw'>begin</span>
|
439
|
+
|
440
|
+
<span class='id identifier rubyid_cleaning_the_house'>cleaning_the_house</span>
|
441
|
+
|
442
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>pooling</span><span class='tstring_end'>'</span></span>
|
443
|
+
|
444
|
+
<span class='id identifier rubyid_pool'>pool</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
445
|
+
<span class='id identifier rubyid_pool'>pool</span> <span class='op'><<</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_initialize_websocket_server'>initialize_websocket_server</span> <span class='rbrace'>}</span>
|
446
|
+
|
447
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>websocket started</span><span class='tstring_end'>'</span></span>
|
448
|
+
|
449
|
+
<span class='kw'>for</span> <span class='id identifier rubyid_i'>i</span> <span class='kw'>in</span> <span class='int'>1</span><span class='op'>..</span><span class='const'>Logging</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_streams'>streams</span>
|
450
|
+
|
451
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>adding twitter adapter #</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_i'>i</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
452
|
+
<span class='id identifier rubyid_pool'>pool</span> <span class='op'><<</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_twitter_adapter'>twitter_adapter</span> <span class='id identifier rubyid_i'>i</span> <span class='rbrace'>}</span>
|
453
|
+
<span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>1</span>
|
454
|
+
|
455
|
+
<span class='kw'>end</span>
|
456
|
+
|
457
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>twitter adapters added</span><span class='tstring_end'>'</span></span>
|
458
|
+
|
459
|
+
<span class='kw'>if</span> <span class='const'>Logging</span><span class='op'>::</span><span class='const'>Settings</span><span class='period'>.</span><span class='id identifier rubyid_rpg'>rpg</span>
|
460
|
+
|
461
|
+
<span class='id identifier rubyid_pool'>pool</span> <span class='op'><<</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_random_adapter'>random_adapter</span> <span class='rbrace'>}</span>
|
462
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>random adapter added</span><span class='tstring_end'>'</span></span>
|
463
|
+
|
464
|
+
<span class='id identifier rubyid_pool'>pool</span> <span class='op'><<</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_random_converter'>random_converter</span> <span class='rbrace'>}</span>
|
465
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>random converter added</span><span class='tstring_end'>'</span></span>
|
466
|
+
|
467
|
+
<span class='kw'>end</span>
|
468
|
+
|
469
|
+
<span class='id identifier rubyid_pool'>pool</span> <span class='op'><<</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_twitter_converter'>twitter_converter</span> <span class='rbrace'>}</span>
|
470
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>twitter converter added</span><span class='tstring_end'>'</span></span>
|
471
|
+
|
472
|
+
<span class='id identifier rubyid_pool'>pool</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_thread'>thread</span><span class='op'>|</span>
|
473
|
+
<span class='id identifier rubyid_thread'>thread</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
474
|
+
<span class='kw'>end</span>
|
475
|
+
|
476
|
+
<span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
477
|
+
|
478
|
+
<span class='const'>Logging</span><span class='op'>::</span><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='id identifier rubyid_e'>e</span><span class='rparen'>)</span>
|
479
|
+
|
480
|
+
<span class='id identifier rubyid_pool'>pool</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_thread'>thread</span><span class='op'>|</span>
|
481
|
+
<span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_kill'>kill</span><span class='lparen'>(</span><span class='id identifier rubyid_thread'>thread</span><span class='rparen'>)</span>
|
482
|
+
|
483
|
+
<span class='kw'>end</span>
|
484
|
+
|
485
|
+
<span class='kw'>end</span>
|
486
|
+
|
487
|
+
<span class='kw'>end</span></pre>
|
488
|
+
</td>
|
489
|
+
</tr>
|
490
|
+
</table>
|
491
|
+
</div>
|
492
|
+
|
493
|
+
</div>
|
494
|
+
|
495
|
+
|
496
|
+
<div id="instance_method_details" class="method_details_list">
|
497
|
+
<h2>Instance Method Details</h2>
|
498
|
+
|
499
|
+
|
500
|
+
<div class="method_details first">
|
501
|
+
<h3 class="signature first" id="cleaning_the_house-instance_method">
|
502
|
+
|
503
|
+
- (<tt>Object</tt>) <strong>cleaning_the_house</strong>
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
</h3><div class="docstring">
|
510
|
+
<div class="discussion">
|
511
|
+
<p>
|
512
|
+
Deletes the db keys previously used
|
513
|
+
</p>
|
514
|
+
|
515
|
+
|
516
|
+
</div>
|
517
|
+
</div>
|
518
|
+
<div class="tags">
|
519
|
+
|
520
|
+
|
521
|
+
</div><table class="source_code">
|
522
|
+
<tr>
|
523
|
+
<td>
|
524
|
+
<pre class="lines">
|
525
|
+
|
526
|
+
|
527
|
+
72
|
528
|
+
73
|
529
|
+
74
|
530
|
+
75
|
531
|
+
76
|
532
|
+
77</pre>
|
533
|
+
</td>
|
534
|
+
<td>
|
535
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 72</span>
|
536
|
+
|
537
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cleaning_the_house'>cleaning_the_house</span>
|
538
|
+
|
539
|
+
<span class='id identifier rubyid_dao'>dao</span> <span class='op'>=</span> <span class='const'>DAO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
540
|
+
<span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_clean'>clean</span>
|
541
|
+
|
542
|
+
<span class='kw'>end</span></pre>
|
543
|
+
</td>
|
544
|
+
</tr>
|
545
|
+
</table>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
<div class="method_details ">
|
549
|
+
<h3 class="signature " id="initialize_websocket_server-instance_method">
|
550
|
+
|
551
|
+
- (<tt>Object</tt>) <strong>initialize_websocket_server</strong>
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
</h3><div class="docstring">
|
558
|
+
<div class="discussion">
|
559
|
+
<p>
|
560
|
+
Starts the WebSocket Server
|
561
|
+
</p>
|
562
|
+
|
563
|
+
|
564
|
+
</div>
|
565
|
+
</div>
|
566
|
+
<div class="tags">
|
567
|
+
|
568
|
+
|
569
|
+
</div><table class="source_code">
|
570
|
+
<tr>
|
571
|
+
<td>
|
572
|
+
<pre class="lines">
|
573
|
+
|
574
|
+
|
575
|
+
80
|
576
|
+
81
|
577
|
+
82
|
578
|
+
83
|
579
|
+
84
|
580
|
+
85</pre>
|
581
|
+
</td>
|
582
|
+
<td>
|
583
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 80</span>
|
584
|
+
|
585
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize_websocket_server'>initialize_websocket_server</span>
|
586
|
+
|
587
|
+
<span class='id identifier rubyid_ws'>ws</span> <span class='op'>=</span> <span class='const'>WebSocketServer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
588
|
+
<span class='id identifier rubyid_ws'>ws</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span>
|
589
|
+
|
590
|
+
<span class='kw'>end</span></pre>
|
591
|
+
</td>
|
592
|
+
</tr>
|
593
|
+
</table>
|
594
|
+
</div>
|
595
|
+
|
596
|
+
<div class="method_details ">
|
597
|
+
<h3 class="signature " id="random_adapter-instance_method">
|
598
|
+
|
599
|
+
- (<tt>Object</tt>) <strong>random_adapter</strong>(stream = 1)
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
</h3><div class="docstring">
|
606
|
+
<div class="discussion">
|
607
|
+
<p>
|
608
|
+
Starts the Random Adapter
|
609
|
+
</p>
|
610
|
+
|
611
|
+
|
612
|
+
</div>
|
613
|
+
</div>
|
614
|
+
<div class="tags">
|
615
|
+
<p class="tag_title">Parameters:</p>
|
616
|
+
<ul class="param">
|
617
|
+
|
618
|
+
<li>
|
619
|
+
|
620
|
+
<span class='name'>stream</span>
|
621
|
+
|
622
|
+
|
623
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
624
|
+
|
625
|
+
|
626
|
+
<em class="default">(defaults to: <tt>1</tt>)</em>
|
627
|
+
|
628
|
+
|
629
|
+
—
|
630
|
+
<div class='inline'><p>
|
631
|
+
the number of the stream
|
632
|
+
</p>
|
633
|
+
</div>
|
634
|
+
|
635
|
+
</li>
|
636
|
+
|
637
|
+
</ul>
|
638
|
+
|
639
|
+
|
640
|
+
</div><table class="source_code">
|
641
|
+
<tr>
|
642
|
+
<td>
|
643
|
+
<pre class="lines">
|
644
|
+
|
645
|
+
|
646
|
+
100
|
647
|
+
101
|
648
|
+
102
|
649
|
+
103
|
650
|
+
104
|
651
|
+
105</pre>
|
652
|
+
</td>
|
653
|
+
<td>
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 100</span>
|
655
|
+
|
656
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_random_adapter'>random_adapter</span> <span class='id identifier rubyid_stream'>stream</span><span class='op'>=</span><span class='int'>1</span>
|
657
|
+
|
658
|
+
<span class='id identifier rubyid_ra'>ra</span> <span class='op'>=</span> <span class='const'>RandomAdapter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
659
|
+
<span class='id identifier rubyid_ra'>ra</span><span class='period'>.</span><span class='id identifier rubyid_connect_stream'>connect_stream</span> <span class='id identifier rubyid_stream'>stream</span>
|
660
|
+
|
661
|
+
<span class='kw'>end</span></pre>
|
662
|
+
</td>
|
663
|
+
</tr>
|
664
|
+
</table>
|
665
|
+
</div>
|
666
|
+
|
667
|
+
<div class="method_details ">
|
668
|
+
<h3 class="signature " id="random_converter-instance_method">
|
669
|
+
|
670
|
+
- (<tt>Object</tt>) <strong>random_converter</strong>
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
</h3><div class="docstring">
|
677
|
+
<div class="discussion">
|
678
|
+
<p>
|
679
|
+
Starts the Random Converter
|
680
|
+
</p>
|
681
|
+
|
682
|
+
|
683
|
+
</div>
|
684
|
+
</div>
|
685
|
+
<div class="tags">
|
686
|
+
|
687
|
+
|
688
|
+
</div><table class="source_code">
|
689
|
+
<tr>
|
690
|
+
<td>
|
691
|
+
<pre class="lines">
|
692
|
+
|
693
|
+
|
694
|
+
137
|
695
|
+
138
|
696
|
+
139
|
697
|
+
140
|
698
|
+
141
|
699
|
+
142
|
700
|
+
143
|
701
|
+
144
|
702
|
+
145
|
703
|
+
146
|
704
|
+
147
|
705
|
+
148
|
706
|
+
149
|
707
|
+
150
|
708
|
+
151
|
709
|
+
152
|
710
|
+
153
|
711
|
+
154
|
712
|
+
155
|
713
|
+
156
|
714
|
+
157
|
715
|
+
158
|
716
|
+
159
|
717
|
+
160
|
718
|
+
161
|
719
|
+
162
|
720
|
+
163</pre>
|
721
|
+
</td>
|
722
|
+
<td>
|
723
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 137</span>
|
724
|
+
|
725
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_random_converter'>random_converter</span>
|
726
|
+
|
727
|
+
<span class='id identifier rubyid_dao'>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>
|
728
|
+
|
729
|
+
<span class='kw'>while</span> <span class='kw'>true</span>
|
730
|
+
|
731
|
+
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span>
|
732
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Status retrieved</span><span class='tstring_end'>'</span></span>
|
733
|
+
|
734
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_status'>status</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
735
|
+
|
736
|
+
<span class='id identifier rubyid_rc'>rc</span> <span class='op'>=</span> <span class='const'>RandomConverter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
737
|
+
<span class='id identifier rubyid_usmf'>usmf</span> <span class='op'>=</span> <span class='id identifier rubyid_rc'>rc</span><span class='period'>.</span><span class='id identifier rubyid_to_usmf'>to_usmf</span> <span class='id identifier rubyid_status'>status</span>
|
738
|
+
|
739
|
+
<span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_publish'>publish</span> <span class='id identifier rubyid_usmf'>usmf</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
740
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Published</span><span class='tstring_end'>'</span></span>
|
741
|
+
|
742
|
+
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span>
|
743
|
+
|
744
|
+
<span class='kw'>end</span>
|
745
|
+
|
746
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>All the statuses were been sent</span><span class='tstring_end'>'</span></span>
|
747
|
+
<span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>2</span>
|
748
|
+
|
749
|
+
<span class='kw'>end</span>
|
750
|
+
|
751
|
+
<span class='kw'>end</span></pre>
|
752
|
+
</td>
|
753
|
+
</tr>
|
754
|
+
</table>
|
755
|
+
</div>
|
756
|
+
|
757
|
+
<div class="method_details ">
|
758
|
+
<h3 class="signature " id="twitter_adapter-instance_method">
|
759
|
+
|
760
|
+
- (<tt>Object</tt>) <strong>twitter_adapter</strong>(stream)
|
761
|
+
|
762
|
+
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
</h3><div class="docstring">
|
767
|
+
<div class="discussion">
|
768
|
+
<p>
|
769
|
+
Starts the Twitter Adapter
|
770
|
+
</p>
|
771
|
+
|
772
|
+
|
773
|
+
</div>
|
774
|
+
</div>
|
775
|
+
<div class="tags">
|
776
|
+
<p class="tag_title">Parameters:</p>
|
777
|
+
<ul class="param">
|
778
|
+
|
779
|
+
<li>
|
780
|
+
|
781
|
+
<span class='name'>stream</span>
|
782
|
+
|
783
|
+
|
784
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
—
|
789
|
+
<div class='inline'><p>
|
790
|
+
the number of the stream
|
791
|
+
</p>
|
792
|
+
</div>
|
793
|
+
|
794
|
+
</li>
|
795
|
+
|
796
|
+
</ul>
|
797
|
+
|
798
|
+
|
799
|
+
</div><table class="source_code">
|
800
|
+
<tr>
|
801
|
+
<td>
|
802
|
+
<pre class="lines">
|
803
|
+
|
804
|
+
|
805
|
+
90
|
806
|
+
91
|
807
|
+
92
|
808
|
+
93
|
809
|
+
94
|
810
|
+
95</pre>
|
811
|
+
</td>
|
812
|
+
<td>
|
813
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 90</span>
|
814
|
+
|
815
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_twitter_adapter'>twitter_adapter</span> <span class='id identifier rubyid_stream'>stream</span>
|
816
|
+
|
817
|
+
<span class='id identifier rubyid_ta'>ta</span> <span class='op'>=</span> <span class='const'>TwitterAdapter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
818
|
+
<span class='id identifier rubyid_ta'>ta</span><span class='period'>.</span><span class='id identifier rubyid_connect_stream'>connect_stream</span> <span class='id identifier rubyid_stream'>stream</span>
|
819
|
+
|
820
|
+
<span class='kw'>end</span></pre>
|
821
|
+
</td>
|
822
|
+
</tr>
|
823
|
+
</table>
|
824
|
+
</div>
|
825
|
+
|
826
|
+
<div class="method_details ">
|
827
|
+
<h3 class="signature " id="twitter_converter-instance_method">
|
828
|
+
|
829
|
+
- (<tt>Object</tt>) <strong>twitter_converter</strong>
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
|
834
|
+
|
835
|
+
</h3><div class="docstring">
|
836
|
+
<div class="discussion">
|
837
|
+
<p>
|
838
|
+
Starts the Twitter Converter
|
839
|
+
</p>
|
840
|
+
|
841
|
+
|
842
|
+
</div>
|
843
|
+
</div>
|
844
|
+
<div class="tags">
|
845
|
+
|
846
|
+
|
847
|
+
</div><table class="source_code">
|
848
|
+
<tr>
|
849
|
+
<td>
|
850
|
+
<pre class="lines">
|
851
|
+
|
852
|
+
|
853
|
+
108
|
854
|
+
109
|
855
|
+
110
|
856
|
+
111
|
857
|
+
112
|
858
|
+
113
|
859
|
+
114
|
860
|
+
115
|
861
|
+
116
|
862
|
+
117
|
863
|
+
118
|
864
|
+
119
|
865
|
+
120
|
866
|
+
121
|
867
|
+
122
|
868
|
+
123
|
869
|
+
124
|
870
|
+
125
|
871
|
+
126
|
872
|
+
127
|
873
|
+
128
|
874
|
+
129
|
875
|
+
130
|
876
|
+
131
|
877
|
+
132
|
878
|
+
133
|
879
|
+
134</pre>
|
880
|
+
</td>
|
881
|
+
<td>
|
882
|
+
<pre class="code"><span class="info file"># File 'lib/kermitpfc.rb', line 108</span>
|
883
|
+
|
884
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_twitter_converter'>twitter_converter</span>
|
885
|
+
|
886
|
+
<span class='id identifier rubyid_dao'>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>
|
887
|
+
|
888
|
+
<span class='kw'>while</span> <span class='kw'>true</span>
|
889
|
+
|
890
|
+
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span>
|
891
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Status retrieved</span><span class='tstring_end'>'</span></span>
|
892
|
+
|
893
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_status'>status</span> <span class='op'>!=</span> <span class='kw'>nil</span>
|
894
|
+
|
895
|
+
<span class='id identifier rubyid_tc'>tc</span> <span class='op'>=</span> <span class='const'>TwitterConverter</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
896
|
+
<span class='id identifier rubyid_usmf'>usmf</span> <span class='op'>=</span> <span class='id identifier rubyid_tc'>tc</span><span class='period'>.</span><span class='id identifier rubyid_to_usmf'>to_usmf</span> <span class='id identifier rubyid_status'>status</span>
|
897
|
+
|
898
|
+
<span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_publish'>publish</span> <span class='id identifier rubyid_usmf'>usmf</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
899
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Published</span><span class='tstring_end'>'</span></span>
|
900
|
+
|
901
|
+
<span class='id identifier rubyid_status'>status</span> <span class='op'>=</span> <span class='id identifier rubyid_dao'>dao</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span>
|
902
|
+
|
903
|
+
<span class='kw'>end</span>
|
904
|
+
|
905
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>All the statuses were been sent</span><span class='tstring_end'>'</span></span>
|
906
|
+
<span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>2</span>
|
907
|
+
|
908
|
+
<span class='kw'>end</span>
|
909
|
+
|
910
|
+
<span class='kw'>end</span></pre>
|
911
|
+
</td>
|
912
|
+
</tr>
|
913
|
+
</table>
|
914
|
+
</div>
|
915
|
+
|
916
|
+
</div>
|
917
|
+
|
918
|
+
</div>
|
919
|
+
|
920
|
+
<div id="footer">
|
921
|
+
Generated on Sat Aug 18 16:24:07 2012 by
|
922
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
923
|
+
0.8.2.1 (ruby-1.9.2).
|
924
|
+
</div>
|
925
|
+
|
926
|
+
</body>
|
927
|
+
</html>
|