primer 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/History.txt +17 -0
  2. data/README.rdoc +74 -35
  3. data/example/README.rdoc +33 -23
  4. data/example/application.rb +2 -2
  5. data/example/console.rb +133 -0
  6. data/example/db/blog.sqlite3 +0 -0
  7. data/example/{models → db}/connection.rb +0 -0
  8. data/example/environment.rb +17 -4
  9. data/example/models/comment.rb +5 -0
  10. data/example/models/post.rb +5 -0
  11. data/example/script/setup_database.rb +8 -2
  12. data/example/views/comments.erb +6 -0
  13. data/example/views/layout.erb +1 -1
  14. data/example/views/show.erb +5 -1
  15. data/lib/primer/bus/amqp.rb +7 -5
  16. data/lib/primer/bus/amqp.rbc +1045 -0
  17. data/lib/primer/bus/memory.rbc +344 -0
  18. data/lib/primer/bus.rb +3 -2
  19. data/lib/primer/bus.rbc +872 -0
  20. data/lib/primer/cache/memory.rbc +1443 -0
  21. data/lib/primer/cache/redis.rb +2 -2
  22. data/lib/primer/cache/redis.rbc +1643 -0
  23. data/lib/primer/cache.rb +2 -16
  24. data/lib/primer/cache.rbc +1502 -0
  25. data/lib/primer/enabler.rbc +414 -0
  26. data/lib/primer/helpers.rbc +1438 -0
  27. data/lib/primer/lazyness.rb +63 -0
  28. data/lib/primer/lazyness.rbc +1442 -0
  29. data/lib/primer/real_time.rbc +1999 -0
  30. data/lib/primer/route_set.rb +1 -0
  31. data/lib/primer/route_set.rbc +1475 -0
  32. data/lib/primer/watcher/active_record_macros.rb +13 -3
  33. data/lib/primer/watcher/active_record_macros.rbc +1796 -0
  34. data/lib/primer/watcher/macros.rb +11 -14
  35. data/lib/primer/watcher/macros.rbc +1628 -0
  36. data/lib/primer/watcher.rb +2 -7
  37. data/lib/primer/watcher.rbc +1416 -0
  38. data/lib/primer/worker/active_record_agent.rb +30 -33
  39. data/lib/primer/worker/active_record_agent.rbc +2840 -0
  40. data/lib/primer/worker/changes_agent.rb +20 -0
  41. data/lib/primer/worker/changes_agent.rbc +578 -0
  42. data/lib/primer/worker.rb +20 -3
  43. data/lib/primer/worker.rbc +1254 -0
  44. data/lib/primer.rb +10 -2
  45. data/lib/primer.rbc +944 -0
  46. data/spec/db/test.sqlite3 +0 -0
  47. data/spec/models/artist.rb +3 -2
  48. data/spec/models/artist.rbc +288 -0
  49. data/spec/models/blog_post.rb +3 -1
  50. data/spec/models/blog_post.rbc +181 -0
  51. data/spec/models/calendar.rbc +209 -0
  52. data/spec/models/concert.rbc +211 -0
  53. data/spec/models/performance.rbc +177 -0
  54. data/spec/models/person.rb +1 -0
  55. data/spec/models/person.rbc +306 -0
  56. data/spec/models/watchable.rbc +363 -0
  57. data/spec/primer/bus_spec.rbc +940 -0
  58. data/spec/primer/cache_spec.rb +3 -3
  59. data/spec/primer/cache_spec.rbc +8535 -0
  60. data/spec/primer/helpers/erb_spec.rb +14 -14
  61. data/spec/primer/helpers/erb_spec.rbc +2485 -0
  62. data/spec/primer/lazyness_spec.rb +61 -0
  63. data/spec/primer/lazyness_spec.rbc +1408 -0
  64. data/spec/primer/watcher/active_record_spec.rb +15 -15
  65. data/spec/primer/watcher/active_record_spec.rbc +5202 -0
  66. data/spec/primer/watcher_spec.rbc +2645 -0
  67. data/spec/schema.rbc +775 -0
  68. data/spec/spec_helper.rb +3 -0
  69. data/spec/spec_helper.rbc +1193 -0
  70. data/spec/templates/page.erb +0 -1
  71. metadata +77 -70
  72. data/example/models/blog_post.rb +0 -4
@@ -0,0 +1,1045 @@
1
+ !RBIX
2
+ 10310238139619683799
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 37
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 99
23
+ 7
24
+ 2
25
+ 65
26
+ 49
27
+ 3
28
+ 2
29
+ 13
30
+ 99
31
+ 12
32
+ 7
33
+ 4
34
+ 12
35
+ 7
36
+ 5
37
+ 12
38
+ 65
39
+ 12
40
+ 49
41
+ 6
42
+ 4
43
+ 15
44
+ 49
45
+ 4
46
+ 0
47
+ 15
48
+ 2
49
+ 11
50
+ I
51
+ 6
52
+ I
53
+ 0
54
+ I
55
+ 0
56
+ I
57
+ 0
58
+ n
59
+ p
60
+ 7
61
+ s
62
+ 4
63
+ amqp
64
+ x
65
+ 7
66
+ require
67
+ x
68
+ 6
69
+ Primer
70
+ x
71
+ 11
72
+ open_module
73
+ x
74
+ 15
75
+ __module_init__
76
+ M
77
+ 1
78
+ n
79
+ n
80
+ x
81
+ 6
82
+ Primer
83
+ i
84
+ 29
85
+ 5
86
+ 66
87
+ 99
88
+ 7
89
+ 0
90
+ 1
91
+ 65
92
+ 49
93
+ 1
94
+ 3
95
+ 13
96
+ 99
97
+ 12
98
+ 7
99
+ 2
100
+ 12
101
+ 7
102
+ 3
103
+ 12
104
+ 65
105
+ 12
106
+ 49
107
+ 4
108
+ 4
109
+ 15
110
+ 49
111
+ 2
112
+ 0
113
+ 11
114
+ I
115
+ 6
116
+ I
117
+ 0
118
+ I
119
+ 0
120
+ I
121
+ 0
122
+ n
123
+ p
124
+ 5
125
+ x
126
+ 3
127
+ Bus
128
+ x
129
+ 10
130
+ open_class
131
+ x
132
+ 14
133
+ __class_init__
134
+ M
135
+ 1
136
+ n
137
+ n
138
+ x
139
+ 3
140
+ Bus
141
+ i
142
+ 31
143
+ 5
144
+ 66
145
+ 99
146
+ 7
147
+ 0
148
+ 45
149
+ 1
150
+ 2
151
+ 65
152
+ 49
153
+ 3
154
+ 3
155
+ 13
156
+ 99
157
+ 12
158
+ 7
159
+ 4
160
+ 12
161
+ 7
162
+ 5
163
+ 12
164
+ 65
165
+ 12
166
+ 49
167
+ 6
168
+ 4
169
+ 15
170
+ 49
171
+ 4
172
+ 0
173
+ 11
174
+ I
175
+ 6
176
+ I
177
+ 0
178
+ I
179
+ 0
180
+ I
181
+ 0
182
+ n
183
+ p
184
+ 7
185
+ x
186
+ 4
187
+ AMQP
188
+ x
189
+ 3
190
+ Bus
191
+ n
192
+ x
193
+ 10
194
+ open_class
195
+ x
196
+ 14
197
+ __class_init__
198
+ M
199
+ 1
200
+ n
201
+ n
202
+ x
203
+ 4
204
+ AMQP
205
+ i
206
+ 76
207
+ 5
208
+ 66
209
+ 99
210
+ 7
211
+ 0
212
+ 7
213
+ 1
214
+ 65
215
+ 67
216
+ 49
217
+ 2
218
+ 0
219
+ 49
220
+ 3
221
+ 4
222
+ 15
223
+ 99
224
+ 7
225
+ 4
226
+ 7
227
+ 5
228
+ 65
229
+ 67
230
+ 49
231
+ 2
232
+ 0
233
+ 49
234
+ 3
235
+ 4
236
+ 15
237
+ 99
238
+ 7
239
+ 6
240
+ 7
241
+ 7
242
+ 65
243
+ 67
244
+ 49
245
+ 2
246
+ 0
247
+ 49
248
+ 3
249
+ 4
250
+ 15
251
+ 5
252
+ 48
253
+ 8
254
+ 15
255
+ 99
256
+ 7
257
+ 9
258
+ 7
259
+ 10
260
+ 65
261
+ 67
262
+ 49
263
+ 2
264
+ 0
265
+ 49
266
+ 3
267
+ 4
268
+ 15
269
+ 99
270
+ 7
271
+ 11
272
+ 7
273
+ 12
274
+ 65
275
+ 67
276
+ 49
277
+ 2
278
+ 0
279
+ 49
280
+ 3
281
+ 4
282
+ 11
283
+ I
284
+ 5
285
+ I
286
+ 0
287
+ I
288
+ 0
289
+ I
290
+ 0
291
+ n
292
+ p
293
+ 13
294
+ x
295
+ 10
296
+ initialize
297
+ M
298
+ 1
299
+ n
300
+ n
301
+ x
302
+ 10
303
+ initialize
304
+ i
305
+ 24
306
+ 23
307
+ 0
308
+ 10
309
+ 14
310
+ 44
311
+ 43
312
+ 0
313
+ 78
314
+ 49
315
+ 1
316
+ 1
317
+ 19
318
+ 0
319
+ 15
320
+ 20
321
+ 0
322
+ 38
323
+ 2
324
+ 15
325
+ 54
326
+ 52
327
+ 3
328
+ 0
329
+ 11
330
+ I
331
+ 3
332
+ I
333
+ 1
334
+ I
335
+ 0
336
+ I
337
+ 1
338
+ n
339
+ p
340
+ 4
341
+ x
342
+ 4
343
+ Hash
344
+ x
345
+ 16
346
+ new_from_literal
347
+ x
348
+ 7
349
+ @config
350
+ x
351
+ 10
352
+ initialize
353
+ p
354
+ 7
355
+ I
356
+ -1
357
+ I
358
+ 7
359
+ I
360
+ e
361
+ I
362
+ 8
363
+ I
364
+ 13
365
+ I
366
+ 9
367
+ I
368
+ 18
369
+ x
370
+ 53
371
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
372
+ p
373
+ 1
374
+ x
375
+ 6
376
+ config
377
+ x
378
+ 17
379
+ method_visibility
380
+ x
381
+ 15
382
+ add_defn_method
383
+ x
384
+ 7
385
+ publish
386
+ M
387
+ 1
388
+ n
389
+ n
390
+ x
391
+ 7
392
+ publish
393
+ i
394
+ 27
395
+ 20
396
+ 0
397
+ 49
398
+ 0
399
+ 0
400
+ 20
401
+ 1
402
+ 35
403
+ 2
404
+ 19
405
+ 2
406
+ 15
407
+ 5
408
+ 48
409
+ 1
410
+ 45
411
+ 2
412
+ 3
413
+ 20
414
+ 2
415
+ 49
416
+ 4
417
+ 1
418
+ 49
419
+ 5
420
+ 1
421
+ 11
422
+ I
423
+ 6
424
+ I
425
+ 3
426
+ I
427
+ 2
428
+ I
429
+ 2
430
+ n
431
+ p
432
+ 6
433
+ x
434
+ 4
435
+ to_s
436
+ x
437
+ 5
438
+ queue
439
+ x
440
+ 6
441
+ Primer
442
+ n
443
+ x
444
+ 9
445
+ serialize
446
+ x
447
+ 7
448
+ publish
449
+ p
450
+ 7
451
+ I
452
+ -1
453
+ I
454
+ c
455
+ I
456
+ 0
457
+ I
458
+ d
459
+ I
460
+ c
461
+ I
462
+ e
463
+ I
464
+ 1b
465
+ x
466
+ 53
467
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
468
+ p
469
+ 3
470
+ x
471
+ 5
472
+ topic
473
+ x
474
+ 7
475
+ message
476
+ x
477
+ 5
478
+ tuple
479
+ x
480
+ 9
481
+ subscribe
482
+ M
483
+ 1
484
+ n
485
+ n
486
+ x
487
+ 9
488
+ subscribe
489
+ i
490
+ 12
491
+ 95
492
+ 19
493
+ 1
494
+ 15
495
+ 5
496
+ 48
497
+ 0
498
+ 15
499
+ 54
500
+ 89
501
+ 1
502
+ 11
503
+ I
504
+ 3
505
+ I
506
+ 2
507
+ I
508
+ 0
509
+ I
510
+ 0
511
+ I
512
+ 0
513
+ p
514
+ 2
515
+ x
516
+ 4
517
+ bind
518
+ x
519
+ 9
520
+ subscribe
521
+ p
522
+ 7
523
+ I
524
+ -1
525
+ I
526
+ 11
527
+ I
528
+ 4
529
+ I
530
+ 12
531
+ I
532
+ 8
533
+ I
534
+ 13
535
+ I
536
+ c
537
+ x
538
+ 53
539
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
540
+ p
541
+ 2
542
+ x
543
+ 4
544
+ args
545
+ x
546
+ 5
547
+ block
548
+ x
549
+ 7
550
+ private
551
+ x
552
+ 5
553
+ queue
554
+ M
555
+ 1
556
+ n
557
+ n
558
+ x
559
+ 5
560
+ queue
561
+ i
562
+ 128
563
+ 45
564
+ 0
565
+ 1
566
+ 49
567
+ 2
568
+ 0
569
+ 15
570
+ 5
571
+ 7
572
+ 3
573
+ 49
574
+ 4
575
+ 1
576
+ 9
577
+ 19
578
+ 7
579
+ 5
580
+ 8
581
+ 20
582
+ 1
583
+ 9
584
+ 27
585
+ 39
586
+ 3
587
+ 11
588
+ 8
589
+ 28
590
+ 1
591
+ 15
592
+ 39
593
+ 6
594
+ 7
595
+ 7
596
+ 49
597
+ 8
598
+ 1
599
+ 9
600
+ 41
601
+ 1
602
+ 8
603
+ 49
604
+ 5
605
+ 7
606
+ 9
607
+ 64
608
+ 47
609
+ 49
610
+ 10
611
+ 1
612
+ 15
613
+ 26
614
+ 93
615
+ 0
616
+ 15
617
+ 29
618
+ 65
619
+ 0
620
+ 7
621
+ 11
622
+ 98
623
+ 12
624
+ 1
625
+ 30
626
+ 8
627
+ 71
628
+ 25
629
+ 92
630
+ 0
631
+ 27
632
+ 8
633
+ 76
634
+ 15
635
+ 7
636
+ 13
637
+ 8
638
+ 77
639
+ 1
640
+ 9
641
+ 84
642
+ 45
643
+ 11
644
+ 14
645
+ 8
646
+ 89
647
+ 44
648
+ 43
649
+ 15
650
+ 43
651
+ 16
652
+ 19
653
+ 0
654
+ 15
655
+ 20
656
+ 0
657
+ 13
658
+ 71
659
+ 17
660
+ 47
661
+ 9
662
+ 112
663
+ 47
664
+ 49
665
+ 18
666
+ 0
667
+ 13
668
+ 47
669
+ 49
670
+ 19
671
+ 0
672
+ 15
673
+ 8
674
+ 115
675
+ 49
676
+ 17
677
+ 0
678
+ 39
679
+ 6
680
+ 7
681
+ 7
682
+ 49
683
+ 8
684
+ 1
685
+ 49
686
+ 7
687
+ 1
688
+ 38
689
+ 3
690
+ 11
691
+ I
692
+ 5
693
+ I
694
+ 1
695
+ I
696
+ 0
697
+ I
698
+ 0
699
+ n
700
+ p
701
+ 20
702
+ x
703
+ 4
704
+ Faye
705
+ n
706
+ x
707
+ 23
708
+ ensure_reactor_running!
709
+ x
710
+ 6
711
+ @queue
712
+ x
713
+ 31
714
+ __instance_variable_defined_p__
715
+ s
716
+ 17
717
+ instance-variable
718
+ x
719
+ 7
720
+ @config
721
+ x
722
+ 5
723
+ queue
724
+ x
725
+ 2
726
+ []
727
+ s
728
+ 20
729
+ I need a queue name!
730
+ x
731
+ 5
732
+ raise
733
+ x
734
+ 2
735
+ MQ
736
+ x
737
+ 16
738
+ vm_const_defined
739
+ s
740
+ 8
741
+ constant
742
+ n
743
+ x
744
+ 4
745
+ AMQP
746
+ x
747
+ 7
748
+ Channel
749
+ x
750
+ 3
751
+ new
752
+ x
753
+ 8
754
+ allocate
755
+ x
756
+ 10
757
+ initialize
758
+ p
759
+ 13
760
+ I
761
+ -1
762
+ I
763
+ 18
764
+ I
765
+ 0
766
+ I
767
+ 19
768
+ I
769
+ 7
770
+ I
771
+ 1a
772
+ I
773
+ 1d
774
+ I
775
+ 1b
776
+ I
777
+ 32
778
+ I
779
+ 1c
780
+ I
781
+ 5c
782
+ I
783
+ 1d
784
+ I
785
+ 80
786
+ x
787
+ 53
788
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
789
+ p
790
+ 1
791
+ x
792
+ 10
793
+ amqp_klass
794
+ x
795
+ 4
796
+ bind
797
+ M
798
+ 1
799
+ n
800
+ n
801
+ x
802
+ 4
803
+ bind
804
+ i
805
+ 23
806
+ 39
807
+ 0
808
+ 9
809
+ 8
810
+ 1
811
+ 11
812
+ 8
813
+ 9
814
+ 1
815
+ 15
816
+ 5
817
+ 48
818
+ 1
819
+ 56
820
+ 2
821
+ 50
822
+ 3
823
+ 0
824
+ 15
825
+ 2
826
+ 38
827
+ 0
828
+ 11
829
+ I
830
+ 2
831
+ I
832
+ 0
833
+ I
834
+ 0
835
+ I
836
+ 0
837
+ n
838
+ p
839
+ 4
840
+ x
841
+ 6
842
+ @bound
843
+ x
844
+ 5
845
+ queue
846
+ M
847
+ 1
848
+ p
849
+ 2
850
+ x
851
+ 9
852
+ for_block
853
+ t
854
+ n
855
+ x
856
+ 4
857
+ bind
858
+ i
859
+ 25
860
+ 57
861
+ 19
862
+ 0
863
+ 15
864
+ 45
865
+ 0
866
+ 1
867
+ 20
868
+ 0
869
+ 49
870
+ 2
871
+ 1
872
+ 19
873
+ 1
874
+ 15
875
+ 5
876
+ 20
877
+ 1
878
+ 36
879
+ 1
880
+ 47
881
+ 51
882
+ 3
883
+ 0
884
+ 11
885
+ I
886
+ 6
887
+ I
888
+ 2
889
+ I
890
+ 1
891
+ I
892
+ 1
893
+ n
894
+ p
895
+ 4
896
+ x
897
+ 6
898
+ Primer
899
+ n
900
+ x
901
+ 11
902
+ deserialize
903
+ x
904
+ 10
905
+ distribute
906
+ p
907
+ 7
908
+ I
909
+ 0
910
+ I
911
+ 22
912
+ I
913
+ 4
914
+ I
915
+ 23
916
+ I
917
+ f
918
+ I
919
+ 24
920
+ I
921
+ 19
922
+ x
923
+ 53
924
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
925
+ p
926
+ 2
927
+ x
928
+ 7
929
+ message
930
+ x
931
+ 4
932
+ data
933
+ x
934
+ 9
935
+ subscribe
936
+ p
937
+ 9
938
+ I
939
+ -1
940
+ I
941
+ 20
942
+ I
943
+ 0
944
+ I
945
+ 21
946
+ I
947
+ a
948
+ I
949
+ 22
950
+ I
951
+ 13
952
+ I
953
+ 26
954
+ I
955
+ 17
956
+ x
957
+ 53
958
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
959
+ p
960
+ 0
961
+ p
962
+ 13
963
+ I
964
+ 2
965
+ I
966
+ 7
967
+ I
968
+ 10
969
+ I
970
+ c
971
+ I
972
+ 1e
973
+ I
974
+ 11
975
+ I
976
+ 2c
977
+ I
978
+ 16
979
+ I
980
+ 30
981
+ I
982
+ 18
983
+ I
984
+ 3e
985
+ I
986
+ 20
987
+ I
988
+ 4c
989
+ x
990
+ 53
991
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
992
+ p
993
+ 0
994
+ x
995
+ 13
996
+ attach_method
997
+ p
998
+ 3
999
+ I
1000
+ 2
1001
+ I
1002
+ 6
1003
+ I
1004
+ 1f
1005
+ x
1006
+ 53
1007
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
1008
+ p
1009
+ 0
1010
+ x
1011
+ 13
1012
+ attach_method
1013
+ p
1014
+ 3
1015
+ I
1016
+ 2
1017
+ I
1018
+ 4
1019
+ I
1020
+ 1d
1021
+ x
1022
+ 53
1023
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
1024
+ p
1025
+ 0
1026
+ x
1027
+ 13
1028
+ attach_method
1029
+ p
1030
+ 5
1031
+ I
1032
+ 0
1033
+ I
1034
+ 1
1035
+ I
1036
+ 9
1037
+ I
1038
+ 3
1039
+ I
1040
+ 25
1041
+ x
1042
+ 53
1043
+ /Users/jcoglan/projects/primer/lib/primer/bus/amqp.rb
1044
+ p
1045
+ 0