isimud 0.7.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rspec +1 -2
  4. data/.ruby-version +1 -1
  5. data/.yardoc/checksums +10 -10
  6. data/.yardoc/object_types +0 -0
  7. data/.yardoc/objects/root.dat +0 -0
  8. data/Gemfile +2 -1
  9. data/Gemfile.lock +63 -73
  10. data/LICENSE.txt +19 -0
  11. data/README.md +51 -3
  12. data/Rakefile +5 -0
  13. data/doc/Isimud/BunnyClient.html +882 -179
  14. data/doc/Isimud/Client.html +236 -18
  15. data/doc/Isimud/Event.html +211 -95
  16. data/doc/Isimud/EventListener.html +325 -307
  17. data/doc/Isimud/EventObserver/ClassMethods.html +14 -14
  18. data/doc/Isimud/EventObserver.html +418 -36
  19. data/doc/Isimud/Generators/ConfigGenerator.html +2 -2
  20. data/doc/Isimud/Generators/InitializerGenerator.html +2 -2
  21. data/doc/Isimud/Generators.html +2 -2
  22. data/doc/Isimud/Logging.html +3 -3
  23. data/doc/Isimud/ModelWatcher/ClassMethods.html +3 -3
  24. data/doc/Isimud/ModelWatcher.html +2 -2
  25. data/doc/Isimud/Railtie.html +2 -2
  26. data/doc/Isimud/TestClient/Queue.html +374 -71
  27. data/doc/Isimud/TestClient.html +169 -161
  28. data/doc/Isimud.html +80 -76
  29. data/doc/_index.html +5 -2
  30. data/doc/file.LICENSE.html +73 -0
  31. data/doc/file.README.html +131 -7
  32. data/doc/file_list.html +3 -0
  33. data/doc/index.html +131 -7
  34. data/doc/method_list.html +183 -105
  35. data/doc/top-level-namespace.html +2 -2
  36. data/isimud.gemspec +18 -16
  37. data/lib/isimud/bunny_client.rb +85 -32
  38. data/lib/isimud/client.rb +23 -7
  39. data/lib/isimud/event.rb +11 -14
  40. data/lib/isimud/event_listener.rb +123 -65
  41. data/lib/isimud/event_observer.rb +70 -10
  42. data/lib/isimud/model_watcher.rb +1 -1
  43. data/lib/isimud/test_client.rb +54 -26
  44. data/lib/isimud/version.rb +1 -1
  45. data/lib/isimud.rb +1 -1
  46. data/spec/internal/app/models/company.rb +8 -10
  47. data/spec/internal/app/models/user.rb +11 -1
  48. data/spec/internal/db/schema.rb +5 -0
  49. data/spec/isimud/bunny_client_spec.rb +21 -9
  50. data/spec/isimud/client_spec.rb +40 -0
  51. data/spec/isimud/event_listener_spec.rb +50 -22
  52. data/spec/isimud/event_observer_spec.rb +107 -16
  53. data/spec/isimud/model_watcher_spec.rb +18 -23
  54. data/spec/isimud/test_client_spec.rb +43 -8
  55. data/spec/isimud_spec.rb +2 -2
  56. data/spec/spec_helper.rb +2 -0
  57. metadata +19 -35
  58. checksums.yaml.gz.sig +0 -0
  59. data/certs/gfeil.pem +0 -21
  60. data/release +0 -31
  61. data.tar.gz.sig +0 -0
  62. metadata.gz.sig +0 -2
@@ -90,11 +90,15 @@
90
90
 
91
91
 
92
92
 
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2"><span class='object_link'><a href="../Logging.html" title="Isimud::Logging (module)">Logging</a></span></dd>
95
+
96
+
93
97
 
94
98
 
95
99
 
96
- <dt class="r2 last">Defined in:</dt>
97
- <dd class="r2 last">lib/isimud/test_client.rb</dd>
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/isimud/test_client.rb</dd>
98
102
 
99
103
  </dl>
100
104
  <div class="clear"></div>
@@ -109,7 +113,7 @@
109
113
  <li class="public ">
110
114
  <span class="summary_signature">
111
115
 
112
- <a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
116
+ <a href="#bindings-instance_method" title="#bindings (instance method)">- (Object) <strong>bindings</strong> </a>
113
117
 
114
118
 
115
119
 
@@ -129,7 +133,7 @@
129
133
 
130
134
 
131
135
  <span class="summary_desc"><div class='inline'>
132
- <p>Returns the value of attribute name.</p>
136
+ <p>Returns the value of attribute bindings.</p>
133
137
  </div></span>
134
138
 
135
139
  </li>
@@ -138,7 +142,7 @@
138
142
  <li class="public ">
139
143
  <span class="summary_signature">
140
144
 
141
- <a href="#routing_keys-instance_method" title="#routing_keys (instance method)">- (Object) <strong>routing_keys</strong> </a>
145
+ <a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
142
146
 
143
147
 
144
148
 
@@ -158,7 +162,34 @@
158
162
 
159
163
 
160
164
  <span class="summary_desc"><div class='inline'>
161
- <p>Returns the value of attribute routing_keys.</p>
165
+ <p>Returns the value of attribute name.</p>
166
+ </div></span>
167
+
168
+ </li>
169
+
170
+
171
+ <li class="public ">
172
+ <span class="summary_signature">
173
+
174
+ <a href="#proc-instance_method" title="#proc (instance method)">- (Object) <strong>proc</strong> </a>
175
+
176
+
177
+
178
+ </span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ <span class="summary_desc"><div class='inline'>
192
+ <p>Returns the value of attribute proc.</p>
162
193
  </div></span>
163
194
 
164
195
  </li>
@@ -180,7 +211,29 @@
180
211
  <li class="public ">
181
212
  <span class="summary_signature">
182
213
 
183
- <a href="#bind-instance_method" title="#bind (instance method)">- (Object) <strong>bind</strong>(exchange, options = {}) </a>
214
+ <a href="#bind-instance_method" title="#bind (instance method)">- (Object) <strong>bind</strong>(exchange, opts = {}) </a>
215
+
216
+
217
+
218
+ </span>
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+ <span class="summary_desc"><div class='inline'></div></span>
229
+
230
+ </li>
231
+
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#cancel-instance_method" title="#cancel (instance method)">- (Object) <strong>cancel</strong> </a>
184
237
 
185
238
 
186
239
 
@@ -202,7 +255,7 @@
202
255
  <li class="public ">
203
256
  <span class="summary_signature">
204
257
 
205
- <a href="#has_matching_key%3F-instance_method" title="#has_matching_key? (instance method)">- (Boolean) <strong>has_matching_key?</strong>(route) </a>
258
+ <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(opts = {}) </a>
206
259
 
207
260
 
208
261
 
@@ -224,7 +277,51 @@
224
277
  <li class="public ">
225
278
  <span class="summary_signature">
226
279
 
227
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (Queue) <strong>initialize</strong>(name, listener) </a>
280
+ <a href="#deliver-instance_method" title="#deliver (instance method)">- (Object) <strong>deliver</strong>(data) </a>
281
+
282
+
283
+
284
+ </span>
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+ <span class="summary_desc"><div class='inline'></div></span>
295
+
296
+ </li>
297
+
298
+
299
+ <li class="public ">
300
+ <span class="summary_signature">
301
+
302
+ <a href="#has_matching_key%3F-instance_method" title="#has_matching_key? (instance method)">- (Boolean) <strong>has_matching_key?</strong>(exchange, route) </a>
303
+
304
+
305
+
306
+ </span>
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+ <span class="summary_desc"><div class='inline'></div></span>
317
+
318
+ </li>
319
+
320
+
321
+ <li class="public ">
322
+ <span class="summary_signature">
323
+
324
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Queue) <strong>initialize</strong>(name, proc = Proc.new{ |_| }) </a>
228
325
 
229
326
 
230
327
 
@@ -250,7 +347,29 @@
250
347
  <li class="public ">
251
348
  <span class="summary_signature">
252
349
 
253
- <a href="#publish-instance_method" title="#publish (instance method)">- (Object) <strong>publish</strong>(data) </a>
350
+ <a href="#make_regexp-instance_method" title="#make_regexp (instance method)">- (Object) <strong>make_regexp</strong>(key) </a>
351
+
352
+
353
+
354
+ </span>
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+ <span class="summary_desc"><div class='inline'></div></span>
365
+
366
+ </li>
367
+
368
+
369
+ <li class="public ">
370
+ <span class="summary_signature">
371
+
372
+ <a href="#unbind-instance_method" title="#unbind (instance method)">- (Object) <strong>unbind</strong>(exchange, opts = {}) </a>
254
373
 
255
374
 
256
375
 
@@ -272,13 +391,24 @@
272
391
  </ul>
273
392
 
274
393
 
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Logging.html" title="Isimud::Logging (module)">Logging</a></span></h3>
404
+ <p class="inherited"><span class='object_link'><a href="../Logging.html#log-instance_method" title="Isimud::Logging#log (method)">#log</a></span>, <span class='object_link'><a href="../Logging.html#logger-instance_method" title="Isimud::Logging#logger (method)">#logger</a></span></p>
275
405
  <div id="constructor_details" class="method_details_list">
276
406
  <h2>Constructor Details</h2>
277
407
 
278
408
  <div class="method_details first">
279
409
  <h3 class="signature first" id="initialize-instance_method">
280
410
 
281
- - (<tt><span class='object_link'><a href="" title="Isimud::TestClient::Queue (class)">Queue</a></span></tt>) <strong>initialize</strong>(name, listener)
411
+ - (<tt><span class='object_link'><a href="" title="Isimud::TestClient::Queue (class)">Queue</a></span></tt>) <strong>initialize</strong>(name, proc = Proc.new{ |_| })
282
412
 
283
413
 
284
414
 
@@ -301,19 +431,19 @@
301
431
  <pre class="lines">
302
432
 
303
433
 
304
- 9
305
- 10
306
- 11
307
- 12
308
- 13</pre>
434
+ 17
435
+ 18
436
+ 19
437
+ 20
438
+ 21</pre>
309
439
  </td>
310
440
  <td>
311
- <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 9</span>
441
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 17</span>
312
442
 
313
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_listener'>listener</span><span class='rparen'>)</span>
443
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_proc'>proc</span> <span class='op'>=</span> <span class='const'>Proc</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid__'>_</span><span class='op'>|</span> <span class='rbrace'>}</span> <span class='rparen'>)</span>
314
444
  <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
315
- <span class='ivar'>@listener</span> <span class='op'>=</span> <span class='id identifier rubyid_listener'>listener</span>
316
- <span class='ivar'>@routing_keys</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
445
+ <span class='ivar'>@bindings</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Set</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='rbrace'>}</span>
446
+ <span class='ivar'>@proc</span> <span class='op'>=</span> <span class='id identifier rubyid_proc'>proc</span>
317
447
  <span class='kw'>end</span></pre>
318
448
  </td>
319
449
  </tr>
@@ -328,7 +458,50 @@
328
458
 
329
459
  <span id=""></span>
330
460
  <div class="method_details first">
331
- <h3 class="signature first" id="name-instance_method">
461
+ <h3 class="signature first" id="bindings-instance_method">
462
+
463
+ - (<tt>Object</tt>) <strong>bindings</strong> <span class="extras">(readonly)</span>
464
+
465
+
466
+
467
+
468
+
469
+ </h3><div class="docstring">
470
+ <div class="discussion">
471
+
472
+ <p>Returns the value of attribute bindings</p>
473
+
474
+
475
+ </div>
476
+ </div>
477
+ <div class="tags">
478
+
479
+
480
+ </div><table class="source_code">
481
+ <tr>
482
+ <td>
483
+ <pre class="lines">
484
+
485
+
486
+ 14
487
+ 15
488
+ 16</pre>
489
+ </td>
490
+ <td>
491
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 14</span>
492
+
493
+ <span class='kw'>def</span> <span class='id identifier rubyid_bindings'>bindings</span>
494
+ <span class='ivar'>@bindings</span>
495
+ <span class='kw'>end</span></pre>
496
+ </td>
497
+ </tr>
498
+ </table>
499
+ </div>
500
+
501
+
502
+ <span id=""></span>
503
+ <div class="method_details ">
504
+ <h3 class="signature " id="name-instance_method">
332
505
 
333
506
  - (<tt>Object</tt>) <strong>name</strong> <span class="extras">(readonly)</span>
334
507
 
@@ -353,12 +526,12 @@
353
526
  <pre class="lines">
354
527
 
355
528
 
356
- 7
357
- 8
358
- 9</pre>
529
+ 14
530
+ 15
531
+ 16</pre>
359
532
  </td>
360
533
  <td>
361
- <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 7</span>
534
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 14</span>
362
535
 
363
536
  <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
364
537
  <span class='ivar'>@name</span>
@@ -369,11 +542,11 @@
369
542
  </div>
370
543
 
371
544
 
372
- <span id=""></span>
545
+ <span id="proc=-instance_method"></span>
373
546
  <div class="method_details ">
374
- <h3 class="signature " id="routing_keys-instance_method">
547
+ <h3 class="signature " id="proc-instance_method">
375
548
 
376
- - (<tt>Object</tt>) <strong>routing_keys</strong> <span class="extras">(readonly)</span>
549
+ - (<tt>Object</tt>) <strong>proc</strong>
377
550
 
378
551
 
379
552
 
@@ -382,7 +555,7 @@
382
555
  </h3><div class="docstring">
383
556
  <div class="discussion">
384
557
 
385
- <p>Returns the value of attribute routing_keys</p>
558
+ <p>Returns the value of attribute proc</p>
386
559
 
387
560
 
388
561
  </div>
@@ -396,15 +569,15 @@
396
569
  <pre class="lines">
397
570
 
398
571
 
399
- 7
400
- 8
401
- 9</pre>
572
+ 15
573
+ 16
574
+ 17</pre>
402
575
  </td>
403
576
  <td>
404
- <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 7</span>
577
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 15</span>
405
578
 
406
- <span class='kw'>def</span> <span class='id identifier rubyid_routing_keys'>routing_keys</span>
407
- <span class='ivar'>@routing_keys</span>
579
+ <span class='kw'>def</span> <span class='id identifier rubyid_proc'>proc</span>
580
+ <span class='ivar'>@proc</span>
408
581
  <span class='kw'>end</span></pre>
409
582
  </td>
410
583
  </tr>
@@ -421,7 +594,7 @@
421
594
  <div class="method_details first">
422
595
  <h3 class="signature first" id="bind-instance_method">
423
596
 
424
- - (<tt>Object</tt>) <strong>bind</strong>(exchange, options = {})
597
+ - (<tt>Object</tt>) <strong>bind</strong>(exchange, opts = {})
425
598
 
426
599
 
427
600
 
@@ -433,17 +606,123 @@
433
606
  <pre class="lines">
434
607
 
435
608
 
436
- 15
437
- 16
438
- 17
439
- 18</pre>
609
+ 23
610
+ 24
611
+ 25
612
+ 26
613
+ 27</pre>
440
614
  </td>
441
615
  <td>
442
- <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 15</span>
616
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 23</span>
617
+
618
+ <span class='kw'>def</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
619
+ <span class='id identifier rubyid_routing_key'>routing_key</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:routing_key</span><span class='rbracket'>]</span>
620
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TestClient: adding routing key </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='embexpr_end'>}</span><span class='tstring_content'> for exchange </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exchange'>exchange</span><span class='embexpr_end'>}</span><span class='tstring_content'> to queue </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
621
+ <span class='ivar'>@bindings</span><span class='lbracket'>[</span><span class='id identifier rubyid_exchange'>exchange</span><span class='rbracket'>]</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_routing_key'>routing_key</span>
622
+ <span class='kw'>end</span></pre>
623
+ </td>
624
+ </tr>
625
+ </table>
626
+ </div>
627
+
628
+ <div class="method_details ">
629
+ <h3 class="signature " id="cancel-instance_method">
630
+
631
+ - (<tt>Object</tt>) <strong>cancel</strong>
632
+
633
+
634
+
635
+
636
+
637
+ </h3><table class="source_code">
638
+ <tr>
639
+ <td>
640
+ <pre class="lines">
641
+
642
+
643
+ 29
644
+ 30
645
+ 31</pre>
646
+ </td>
647
+ <td>
648
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 29</span>
649
+
650
+ <span class='kw'>def</span> <span class='id identifier rubyid_cancel'>cancel</span>
651
+ <span class='ivar'>@proc</span> <span class='op'>=</span> <span class='kw'>nil</span>
652
+ <span class='kw'>end</span></pre>
653
+ </td>
654
+ </tr>
655
+ </table>
656
+ </div>
657
+
658
+ <div class="method_details ">
659
+ <h3 class="signature " id="delete-instance_method">
660
+
661
+ - (<tt>Object</tt>) <strong>delete</strong>(opts = {})
662
+
443
663
 
444
- <span class='kw'>def</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
445
- <span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:routing_key</span><span class='rbracket'>]</span>
446
- <span class='ivar'>@routing_keys</span> <span class='op'>&lt;&lt;</span> <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\.</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\\.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\*</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.*</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
664
+
665
+
666
+
667
+ </h3><table class="source_code">
668
+ <tr>
669
+ <td>
670
+ <pre class="lines">
671
+
672
+
673
+ 33
674
+ 34
675
+ 35
676
+ 36
677
+ 37</pre>
678
+ </td>
679
+ <td>
680
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 33</span>
681
+
682
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
683
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TestClient: delete queue </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
684
+ <span class='ivar'>@bindings</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
685
+ <span class='ivar'>@proc</span> <span class='op'>=</span> <span class='kw'>nil</span>
686
+ <span class='kw'>end</span></pre>
687
+ </td>
688
+ </tr>
689
+ </table>
690
+ </div>
691
+
692
+ <div class="method_details ">
693
+ <h3 class="signature " id="deliver-instance_method">
694
+
695
+ - (<tt>Object</tt>) <strong>deliver</strong>(data)
696
+
697
+
698
+
699
+
700
+
701
+ </h3><table class="source_code">
702
+ <tr>
703
+ <td>
704
+ <pre class="lines">
705
+
706
+
707
+ 53
708
+ 54
709
+ 55
710
+ 56
711
+ 57
712
+ 58
713
+ 59
714
+ 60</pre>
715
+ </td>
716
+ <td>
717
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 53</span>
718
+
719
+ <span class='kw'>def</span> <span class='id identifier rubyid_deliver'>deliver</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
720
+ <span class='kw'>begin</span>
721
+ <span class='ivar'>@proc</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:call</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
722
+ <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
723
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TestClient: error delivering message: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:error</span>
724
+ <span class='id identifier rubyid_run_exception_handlers'>run_exception_handlers</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span>
725
+ <span class='kw'>end</span>
447
726
  <span class='kw'>end</span></pre>
448
727
  </td>
449
728
  </tr>
@@ -453,7 +732,7 @@
453
732
  <div class="method_details ">
454
733
  <h3 class="signature " id="has_matching_key?-instance_method">
455
734
 
456
- - (<tt>Boolean</tt>) <strong>has_matching_key?</strong>(route)
735
+ - (<tt>Boolean</tt>) <strong>has_matching_key?</strong>(exchange, route)
457
736
 
458
737
 
459
738
 
@@ -487,15 +766,15 @@
487
766
  <pre class="lines">
488
767
 
489
768
 
490
- 20
491
- 21
492
- 22</pre>
769
+ 49
770
+ 50
771
+ 51</pre>
493
772
  </td>
494
773
  <td>
495
- <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 20</span>
774
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 49</span>
496
775
 
497
- <span class='kw'>def</span> <span class='id identifier rubyid_has_matching_key?'>has_matching_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_route'>route</span><span class='rparen'>)</span>
498
- <span class='ivar'>@routing_keys</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_route'>route</span> <span class='op'>=~</span> <span class='id identifier rubyid_k'>k</span> <span class='rbrace'>}</span>
776
+ <span class='kw'>def</span> <span class='id identifier rubyid_has_matching_key?'>has_matching_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_route'>route</span><span class='rparen'>)</span>
777
+ <span class='ivar'>@bindings</span><span class='lbracket'>[</span><span class='id identifier rubyid_exchange'>exchange</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_route'>route</span> <span class='op'>=~</span> <span class='id identifier rubyid_make_regexp'>make_regexp</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
499
778
  <span class='kw'>end</span></pre>
500
779
  </td>
501
780
  </tr>
@@ -503,9 +782,9 @@
503
782
  </div>
504
783
 
505
784
  <div class="method_details ">
506
- <h3 class="signature " id="publish-instance_method">
785
+ <h3 class="signature " id="make_regexp-instance_method">
507
786
 
508
- - (<tt>Object</tt>) <strong>publish</strong>(data)
787
+ - (<tt>Object</tt>) <strong>make_regexp</strong>(key)
509
788
 
510
789
 
511
790
 
@@ -517,25 +796,49 @@
517
796
  <pre class="lines">
518
797
 
519
798
 
520
- 24
521
- 25
522
- 26
523
- 27
524
- 28
525
- 29
526
- 30
527
- 31</pre>
799
+ 45
800
+ 46
801
+ 47</pre>
528
802
  </td>
529
803
  <td>
530
- <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 24</span>
804
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 45</span>
531
805
 
532
- <span class='kw'>def</span> <span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
533
- <span class='kw'>begin</span>
534
- <span class='ivar'>@listener</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
535
- <span class='kw'>rescue</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
536
- <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TestClient: error delivering message: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
537
- <span class='ivar'>@listener</span><span class='period'>.</span><span class='id identifier rubyid_exception_handler'>exception_handler</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:call</span><span class='comma'>,</span> <span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span>
538
- <span class='kw'>end</span>
806
+ <span class='kw'>def</span> <span class='id identifier rubyid_make_regexp'>make_regexp</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
807
+ <span class='const'>Regexp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\.</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\\.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\*</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.*</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
808
+ <span class='kw'>end</span></pre>
809
+ </td>
810
+ </tr>
811
+ </table>
812
+ </div>
813
+
814
+ <div class="method_details ">
815
+ <h3 class="signature " id="unbind-instance_method">
816
+
817
+ - (<tt>Object</tt>) <strong>unbind</strong>(exchange, opts = {})
818
+
819
+
820
+
821
+
822
+
823
+ </h3><table class="source_code">
824
+ <tr>
825
+ <td>
826
+ <pre class="lines">
827
+
828
+
829
+ 39
830
+ 40
831
+ 41
832
+ 42
833
+ 43</pre>
834
+ </td>
835
+ <td>
836
+ <pre class="code"><span class="info file"># File 'lib/isimud/test_client.rb', line 39</span>
837
+
838
+ <span class='kw'>def</span> <span class='id identifier rubyid_unbind'>unbind</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
839
+ <span class='id identifier rubyid_routing_key'>routing_key</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:routing_key</span><span class='rbracket'>]</span>
840
+ <span class='id identifier rubyid_log'>log</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>TestClient: removing routing key </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='embexpr_end'>}</span><span class='tstring_content'> for exchange </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exchange'>exchange</span><span class='embexpr_end'>}</span><span class='tstring_content'> from queue </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
841
+ <span class='ivar'>@bindings</span><span class='lbracket'>[</span><span class='id identifier rubyid_exchange'>exchange</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_routing_key'>routing_key</span><span class='rparen'>)</span>
539
842
  <span class='kw'>end</span></pre>
540
843
  </td>
541
844
  </tr>
@@ -547,9 +850,9 @@
547
850
  </div>
548
851
 
549
852
  <div id="footer">
550
- Generated on Fri Apr 3 09:28:09 2015 by
853
+ Generated on Wed Jan 13 16:27:29 2016 by
551
854
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
552
- 0.8.7.6 (ruby-2.2.1).
855
+ 0.8.7.6 (ruby-2.2.3).
553
856
  </div>
554
857
 
555
858
  </body>