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
@@ -250,7 +250,7 @@
250
250
  <li class="public ">
251
251
  <span class="summary_signature">
252
252
 
253
- <a href="#create_queue-instance_method" title="#create_queue (instance method)">- (Object) <strong>create_queue</strong>(queue_name, exchange_name, options = {}, &amp;method) </a>
253
+ <a href="#create_queue-instance_method" title="#create_queue (instance method)">- (Object) <strong>create_queue</strong>(queue_name, exchange_name, options = {}) </a>
254
254
 
255
255
 
256
256
 
@@ -294,7 +294,7 @@
294
294
  <li class="public ">
295
295
  <span class="summary_signature">
296
296
 
297
- <a href="#exception_handler-instance_method" title="#exception_handler (instance method)">- (Object) <strong>exception_handler</strong>(&amp;block) </a>
297
+ <a href="#find_queue-instance_method" title="#find_queue (instance method)">- (Object) <strong>find_queue</strong>(queue_name, options = {}) </a>
298
298
 
299
299
 
300
300
 
@@ -336,6 +336,31 @@
336
336
  <p>A new instance of Client.</p>
337
337
  </div></span>
338
338
 
339
+ </li>
340
+
341
+
342
+ <li class="public ">
343
+ <span class="summary_signature">
344
+
345
+ <a href="#on_exception-instance_method" title="#on_exception (instance method)">- (Object) <strong>on_exception</strong> {|e| ... }</a>
346
+
347
+
348
+
349
+ </span>
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+ <span class="summary_desc"><div class='inline'>
360
+ <p>Declare a proc to be run whenever an uncaught exception is raised within a
361
+ message processing block.</p>
362
+ </div></span>
363
+
339
364
  </li>
340
365
 
341
366
 
@@ -400,6 +425,52 @@
400
425
 
401
426
 
402
427
 
428
+ <span class="summary_desc"><div class='inline'></div></span>
429
+
430
+ </li>
431
+
432
+
433
+ <li class="public ">
434
+ <span class="summary_signature">
435
+
436
+ <a href="#run_exception_handlers-instance_method" title="#run_exception_handlers (instance method)">- (Object) <strong>run_exception_handlers</strong>(exception) </a>
437
+
438
+
439
+
440
+ </span>
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+ <span class="summary_desc"><div class='inline'>
451
+ <p>Call each of the exception handlers declared by #on_exception.</p>
452
+ </div></span>
453
+
454
+ </li>
455
+
456
+
457
+ <li class="public ">
458
+ <span class="summary_signature">
459
+
460
+ <a href="#subscribe-instance_method" title="#subscribe (instance method)">- (Object) <strong>subscribe</strong>(queue, options = {}, &amp;block) </a>
461
+
462
+
463
+
464
+ </span>
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
403
474
  <span class="summary_desc"><div class='inline'></div></span>
404
475
 
405
476
  </li>
@@ -633,7 +704,7 @@
633
704
  <div class="method_details ">
634
705
  <h3 class="signature " id="create_queue-instance_method">
635
706
 
636
- - (<tt>Object</tt>) <strong>create_queue</strong>(queue_name, exchange_name, options = {}, &amp;method)
707
+ - (<tt>Object</tt>) <strong>create_queue</strong>(queue_name, exchange_name, options = {})
637
708
 
638
709
 
639
710
 
@@ -651,7 +722,7 @@
651
722
  <td>
652
723
  <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 24</span>
653
724
 
654
- <span class='kw'>def</span> <span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</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='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
725
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_queue'>create_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</span><span class='comma'>,</span> <span class='id identifier rubyid_exchange_name'>exchange_name</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>
655
726
  <span class='kw'>end</span></pre>
656
727
  </td>
657
728
  </tr>
@@ -687,9 +758,9 @@
687
758
  </div>
688
759
 
689
760
  <div class="method_details ">
690
- <h3 class="signature " id="exception_handler-instance_method">
761
+ <h3 class="signature " id="find_queue-instance_method">
691
762
 
692
- - (<tt>Object</tt>) <strong>exception_handler</strong>(&amp;block)
763
+ - (<tt>Object</tt>) <strong>find_queue</strong>(queue_name, options = {})
693
764
 
694
765
 
695
766
 
@@ -707,7 +778,70 @@
707
778
  <td>
708
779
  <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 30</span>
709
780
 
710
- <span class='kw'>def</span> <span class='id identifier rubyid_exception_handler'>exception_handler</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
781
+ <span class='kw'>def</span> <span class='id identifier rubyid_find_queue'>find_queue</span><span class='lparen'>(</span><span class='id identifier rubyid_queue_name'>queue_name</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>
782
+ <span class='kw'>end</span></pre>
783
+ </td>
784
+ </tr>
785
+ </table>
786
+ </div>
787
+
788
+ <div class="method_details ">
789
+ <h3 class="signature " id="on_exception-instance_method">
790
+
791
+ - (<tt>Object</tt>) <strong>on_exception</strong> {|e| ... }
792
+
793
+
794
+
795
+
796
+
797
+ </h3><div class="docstring">
798
+ <div class="discussion">
799
+
800
+ <p>Declare a proc to be run whenever an uncaught exception is raised within a
801
+ message processing block. This is useful for logging or monitoring errors,
802
+ for instance.</p>
803
+
804
+
805
+ </div>
806
+ </div>
807
+ <div class="tags">
808
+
809
+ <p class="tag_title">Yield Parameters:</p>
810
+ <ul class="yieldparam">
811
+
812
+ <li>
813
+
814
+ <span class='name'>e</span>
815
+
816
+
817
+ <span class='type'>(<tt>Exception</tt>)</span>
818
+
819
+
820
+
821
+ &mdash;
822
+ <div class='inline'>
823
+ <p>exception raised</p>
824
+ </div>
825
+
826
+ </li>
827
+
828
+ </ul>
829
+
830
+ </div><table class="source_code">
831
+ <tr>
832
+ <td>
833
+ <pre class="lines">
834
+
835
+
836
+ 36
837
+ 37
838
+ 38</pre>
839
+ </td>
840
+ <td>
841
+ <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 36</span>
842
+
843
+ <span class='kw'>def</span> <span class='id identifier rubyid_on_exception'>on_exception</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
844
+ <span class='id identifier rubyid_exception_handlers'>exception_handlers</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_block'>block</span>
711
845
  <span class='kw'>end</span></pre>
712
846
  </td>
713
847
  </tr>
@@ -729,11 +863,11 @@
729
863
  <pre class="lines">
730
864
 
731
865
 
732
- 33
733
- 34</pre>
866
+ 46
867
+ 47</pre>
734
868
  </td>
735
869
  <td>
736
- <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 33</span>
870
+ <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 46</span>
737
871
 
738
872
  <span class='kw'>def</span> <span class='id identifier rubyid_publish'>publish</span><span class='lparen'>(</span><span class='id identifier rubyid_exchange'>exchange</span><span class='comma'>,</span> <span class='id identifier rubyid_routing_key'>routing_key</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
739
873
  <span class='kw'>end</span></pre>
@@ -757,11 +891,11 @@
757
891
  <pre class="lines">
758
892
 
759
893
 
760
- 36
761
- 37</pre>
894
+ 49
895
+ 50</pre>
762
896
  </td>
763
897
  <td>
764
- <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 36</span>
898
+ <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 49</span>
765
899
 
766
900
  <span class='kw'>def</span> <span class='id identifier rubyid_reconnect'>reconnect</span>
767
901
  <span class='kw'>end</span></pre>
@@ -785,17 +919,101 @@
785
919
  <pre class="lines">
786
920
 
787
921
 
788
- 39
789
- 40</pre>
922
+ 52
923
+ 53</pre>
790
924
  </td>
791
925
  <td>
792
- <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 39</span>
926
+ <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 52</span>
793
927
 
794
928
  <span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span>
795
929
  <span class='kw'>end</span></pre>
796
930
  </td>
797
931
  </tr>
798
932
  </table>
933
+ </div>
934
+
935
+ <div class="method_details ">
936
+ <h3 class="signature " id="run_exception_handlers-instance_method">
937
+
938
+ - (<tt>Object</tt>) <strong>run_exception_handlers</strong>(exception)
939
+
940
+
941
+
942
+
943
+
944
+ </h3><div class="docstring">
945
+ <div class="discussion">
946
+
947
+ <p>Call each of the exception handlers declared by #on_exception.</p>
948
+
949
+
950
+ </div>
951
+ </div>
952
+ <div class="tags">
953
+ <p class="tag_title">Parameters:</p>
954
+ <ul class="param">
955
+
956
+ <li>
957
+
958
+ <span class='name'>exception</span>
959
+
960
+
961
+ <span class='type'>(<tt>Exception</tt>)</span>
962
+
963
+
964
+
965
+ </li>
966
+
967
+ </ul>
968
+
969
+
970
+ </div><table class="source_code">
971
+ <tr>
972
+ <td>
973
+ <pre class="lines">
974
+
975
+
976
+ 42
977
+ 43
978
+ 44</pre>
979
+ </td>
980
+ <td>
981
+ <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 42</span>
982
+
983
+ <span class='kw'>def</span> <span class='id identifier rubyid_run_exception_handlers'>run_exception_handlers</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span>
984
+ <span class='id identifier rubyid_exception_handlers'>exception_handlers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_handler'>handler</span><span class='op'>|</span> <span class='id identifier rubyid_handler'>handler</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span><span class='rbrace'>}</span>
985
+ <span class='kw'>end</span></pre>
986
+ </td>
987
+ </tr>
988
+ </table>
989
+ </div>
990
+
991
+ <div class="method_details ">
992
+ <h3 class="signature " id="subscribe-instance_method">
993
+
994
+ - (<tt>Object</tt>) <strong>subscribe</strong>(queue, options = {}, &amp;block)
995
+
996
+
997
+
998
+
999
+
1000
+ </h3><table class="source_code">
1001
+ <tr>
1002
+ <td>
1003
+ <pre class="lines">
1004
+
1005
+
1006
+ 55
1007
+ 56</pre>
1008
+ </td>
1009
+ <td>
1010
+ <pre class="code"><span class="info file"># File 'lib/isimud/client.rb', line 55</span>
1011
+
1012
+ <span class='kw'>def</span> <span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_queue'>queue</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='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
1013
+ <span class='kw'>end</span></pre>
1014
+ </td>
1015
+ </tr>
1016
+ </table>
799
1017
  </div>
800
1018
 
801
1019
  </div>
@@ -803,9 +1021,9 @@
803
1021
  </div>
804
1022
 
805
1023
  <div id="footer">
806
- Generated on Fri Apr 3 09:28:08 2015 by
1024
+ Generated on Wed Jan 13 16:27:29 2016 by
807
1025
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
808
- 0.8.7.6 (ruby-2.2.1).
1026
+ 0.8.7.6 (ruby-2.2.3).
809
1027
  </div>
810
1028
 
811
1029
  </body>