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
data/lib/primer.rbc ADDED
@@ -0,0 +1,944 @@
1
+ !RBIX
2
+ 10310238139619683799
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 55
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 7
24
+ 2
25
+ 64
26
+ 47
27
+ 49
28
+ 1
29
+ 1
30
+ 15
31
+ 5
32
+ 7
33
+ 3
34
+ 64
35
+ 47
36
+ 49
37
+ 1
38
+ 1
39
+ 15
40
+ 99
41
+ 7
42
+ 4
43
+ 65
44
+ 49
45
+ 5
46
+ 2
47
+ 13
48
+ 99
49
+ 12
50
+ 7
51
+ 6
52
+ 12
53
+ 7
54
+ 7
55
+ 12
56
+ 65
57
+ 12
58
+ 49
59
+ 8
60
+ 4
61
+ 15
62
+ 49
63
+ 6
64
+ 0
65
+ 15
66
+ 2
67
+ 11
68
+ I
69
+ 6
70
+ I
71
+ 0
72
+ I
73
+ 0
74
+ I
75
+ 0
76
+ n
77
+ p
78
+ 9
79
+ s
80
+ 4
81
+ json
82
+ x
83
+ 7
84
+ require
85
+ s
86
+ 4
87
+ faye
88
+ s
89
+ 3
90
+ set
91
+ x
92
+ 6
93
+ Primer
94
+ x
95
+ 11
96
+ open_module
97
+ x
98
+ 15
99
+ __module_init__
100
+ M
101
+ 1
102
+ n
103
+ n
104
+ x
105
+ 6
106
+ Primer
107
+ i
108
+ 292
109
+ 5
110
+ 66
111
+ 65
112
+ 7
113
+ 0
114
+ 45
115
+ 1
116
+ 2
117
+ 45
118
+ 1
119
+ 3
120
+ 65
121
+ 49
122
+ 4
123
+ 0
124
+ 49
125
+ 5
126
+ 1
127
+ 49
128
+ 6
129
+ 1
130
+ 49
131
+ 7
132
+ 2
133
+ 15
134
+ 99
135
+ 7
136
+ 8
137
+ 45
138
+ 9
139
+ 10
140
+ 65
141
+ 49
142
+ 11
143
+ 3
144
+ 15
145
+ 1
146
+ 15
147
+ 99
148
+ 7
149
+ 12
150
+ 45
151
+ 9
152
+ 13
153
+ 65
154
+ 49
155
+ 11
156
+ 3
157
+ 15
158
+ 1
159
+ 15
160
+ 5
161
+ 7
162
+ 14
163
+ 45
164
+ 0
165
+ 15
166
+ 7
167
+ 16
168
+ 64
169
+ 81
170
+ 17
171
+ 47
172
+ 49
173
+ 18
174
+ 2
175
+ 15
176
+ 5
177
+ 7
178
+ 19
179
+ 45
180
+ 0
181
+ 20
182
+ 7
183
+ 21
184
+ 64
185
+ 81
186
+ 17
187
+ 47
188
+ 49
189
+ 18
190
+ 2
191
+ 15
192
+ 5
193
+ 7
194
+ 22
195
+ 45
196
+ 0
197
+ 23
198
+ 7
199
+ 24
200
+ 64
201
+ 81
202
+ 17
203
+ 47
204
+ 49
205
+ 18
206
+ 2
207
+ 15
208
+ 5
209
+ 7
210
+ 25
211
+ 45
212
+ 0
213
+ 26
214
+ 7
215
+ 27
216
+ 64
217
+ 81
218
+ 17
219
+ 47
220
+ 49
221
+ 18
222
+ 2
223
+ 15
224
+ 5
225
+ 7
226
+ 28
227
+ 45
228
+ 0
229
+ 29
230
+ 7
231
+ 30
232
+ 64
233
+ 81
234
+ 17
235
+ 47
236
+ 49
237
+ 18
238
+ 2
239
+ 15
240
+ 5
241
+ 7
242
+ 31
243
+ 45
244
+ 0
245
+ 32
246
+ 7
247
+ 33
248
+ 64
249
+ 81
250
+ 17
251
+ 47
252
+ 49
253
+ 18
254
+ 2
255
+ 15
256
+ 5
257
+ 7
258
+ 34
259
+ 45
260
+ 0
261
+ 35
262
+ 7
263
+ 36
264
+ 64
265
+ 81
266
+ 17
267
+ 47
268
+ 49
269
+ 18
270
+ 2
271
+ 15
272
+ 5
273
+ 7
274
+ 37
275
+ 45
276
+ 0
277
+ 38
278
+ 7
279
+ 39
280
+ 64
281
+ 81
282
+ 17
283
+ 47
284
+ 49
285
+ 18
286
+ 2
287
+ 15
288
+ 5
289
+ 7
290
+ 40
291
+ 45
292
+ 0
293
+ 41
294
+ 7
295
+ 42
296
+ 64
297
+ 81
298
+ 17
299
+ 47
300
+ 49
301
+ 18
302
+ 2
303
+ 15
304
+ 5
305
+ 99
306
+ 43
307
+ 43
308
+ 12
309
+ 49
310
+ 44
311
+ 1
312
+ 13
313
+ 99
314
+ 12
315
+ 7
316
+ 45
317
+ 12
318
+ 7
319
+ 46
320
+ 12
321
+ 65
322
+ 12
323
+ 49
324
+ 47
325
+ 4
326
+ 15
327
+ 54
328
+ 50
329
+ 45
330
+ 0
331
+ 15
332
+ 5
333
+ 45
334
+ 19
335
+ 48
336
+ 43
337
+ 49
338
+ 13
339
+ 71
340
+ 50
341
+ 47
342
+ 9
343
+ 247
344
+ 47
345
+ 49
346
+ 51
347
+ 0
348
+ 13
349
+ 47
350
+ 49
351
+ 52
352
+ 0
353
+ 15
354
+ 8
355
+ 250
356
+ 49
357
+ 50
358
+ 0
359
+ 13
360
+ 18
361
+ 2
362
+ 47
363
+ 49
364
+ 53
365
+ 1
366
+ 15
367
+ 15
368
+ 99
369
+ 7
370
+ 54
371
+ 7
372
+ 55
373
+ 65
374
+ 5
375
+ 49
376
+ 47
377
+ 4
378
+ 15
379
+ 99
380
+ 7
381
+ 56
382
+ 7
383
+ 57
384
+ 65
385
+ 5
386
+ 49
387
+ 47
388
+ 4
389
+ 15
390
+ 99
391
+ 7
392
+ 58
393
+ 7
394
+ 59
395
+ 65
396
+ 5
397
+ 49
398
+ 47
399
+ 4
400
+ 11
401
+ I
402
+ 6
403
+ I
404
+ 0
405
+ I
406
+ 0
407
+ I
408
+ 0
409
+ n
410
+ p
411
+ 60
412
+ x
413
+ 4
414
+ ROOT
415
+ x
416
+ 4
417
+ File
418
+ n
419
+ n
420
+ x
421
+ 11
422
+ active_path
423
+ x
424
+ 7
425
+ dirname
426
+ x
427
+ 11
428
+ expand_path
429
+ x
430
+ 9
431
+ const_set
432
+ x
433
+ 10
434
+ InvalidKey
435
+ x
436
+ 13
437
+ StandardError
438
+ n
439
+ x
440
+ 10
441
+ open_class
442
+ x
443
+ 13
444
+ RouteNotFound
445
+ n
446
+ x
447
+ 5
448
+ Cache
449
+ n
450
+ s
451
+ 13
452
+ /primer/cache
453
+ x
454
+ 1
455
+ +
456
+ x
457
+ 8
458
+ autoload
459
+ x
460
+ 3
461
+ Bus
462
+ n
463
+ s
464
+ 11
465
+ /primer/bus
466
+ x
467
+ 8
468
+ RouteSet
469
+ n
470
+ s
471
+ 17
472
+ /primer/route_set
473
+ x
474
+ 7
475
+ Enabler
476
+ n
477
+ s
478
+ 15
479
+ /primer/enabler
480
+ x
481
+ 7
482
+ Watcher
483
+ n
484
+ s
485
+ 15
486
+ /primer/watcher
487
+ x
488
+ 8
489
+ Lazyness
490
+ n
491
+ s
492
+ 16
493
+ /primer/lazyness
494
+ x
495
+ 7
496
+ Helpers
497
+ n
498
+ s
499
+ 15
500
+ /primer/helpers
501
+ x
502
+ 8
503
+ RealTime
504
+ n
505
+ s
506
+ 17
507
+ /primer/real_time
508
+ x
509
+ 6
510
+ Worker
511
+ n
512
+ s
513
+ 14
514
+ /primer/worker
515
+ x
516
+ 4
517
+ Type
518
+ x
519
+ 22
520
+ object_singleton_class
521
+ x
522
+ 18
523
+ __metaclass_init__
524
+ M
525
+ 1
526
+ n
527
+ n
528
+ x
529
+ 18
530
+ __metaclass_init__
531
+ i
532
+ 14
533
+ 5
534
+ 66
535
+ 5
536
+ 7
537
+ 0
538
+ 7
539
+ 1
540
+ 7
541
+ 2
542
+ 47
543
+ 49
544
+ 3
545
+ 3
546
+ 11
547
+ I
548
+ 4
549
+ I
550
+ 0
551
+ I
552
+ 0
553
+ I
554
+ 0
555
+ n
556
+ p
557
+ 4
558
+ x
559
+ 5
560
+ cache
561
+ x
562
+ 3
563
+ bus
564
+ x
565
+ 9
566
+ real_time
567
+ x
568
+ 13
569
+ attr_accessor
570
+ p
571
+ 3
572
+ I
573
+ 2
574
+ I
575
+ 16
576
+ I
577
+ e
578
+ x
579
+ 44
580
+ /Users/jcoglan/projects/primer/lib/primer.rb
581
+ p
582
+ 0
583
+ x
584
+ 13
585
+ attach_method
586
+ n
587
+ x
588
+ 6
589
+ Memory
590
+ x
591
+ 3
592
+ new
593
+ x
594
+ 8
595
+ allocate
596
+ x
597
+ 10
598
+ initialize
599
+ x
600
+ 4
601
+ bus=
602
+ x
603
+ 7
604
+ worker!
605
+ M
606
+ 1
607
+ n
608
+ n
609
+ x
610
+ 7
611
+ worker!
612
+ i
613
+ 28
614
+ 45
615
+ 0
616
+ 1
617
+ 13
618
+ 71
619
+ 2
620
+ 47
621
+ 9
622
+ 21
623
+ 47
624
+ 49
625
+ 3
626
+ 0
627
+ 13
628
+ 47
629
+ 49
630
+ 4
631
+ 0
632
+ 15
633
+ 8
634
+ 24
635
+ 49
636
+ 2
637
+ 0
638
+ 49
639
+ 5
640
+ 0
641
+ 11
642
+ I
643
+ 2
644
+ I
645
+ 0
646
+ I
647
+ 0
648
+ I
649
+ 0
650
+ n
651
+ p
652
+ 6
653
+ x
654
+ 6
655
+ Worker
656
+ n
657
+ x
658
+ 3
659
+ new
660
+ x
661
+ 8
662
+ allocate
663
+ x
664
+ 10
665
+ initialize
666
+ x
667
+ 4
668
+ run!
669
+ p
670
+ 5
671
+ I
672
+ -1
673
+ I
674
+ 1b
675
+ I
676
+ 0
677
+ I
678
+ 1c
679
+ I
680
+ 1c
681
+ x
682
+ 44
683
+ /Users/jcoglan/projects/primer/lib/primer.rb
684
+ p
685
+ 0
686
+ x
687
+ 9
688
+ serialize
689
+ M
690
+ 1
691
+ n
692
+ n
693
+ x
694
+ 9
695
+ serialize
696
+ i
697
+ 29
698
+ 20
699
+ 0
700
+ 7
701
+ 0
702
+ 49
703
+ 1
704
+ 1
705
+ 9
706
+ 18
707
+ 20
708
+ 0
709
+ 35
710
+ 1
711
+ 49
712
+ 0
713
+ 0
714
+ 8
715
+ 28
716
+ 45
717
+ 2
718
+ 3
719
+ 20
720
+ 0
721
+ 35
722
+ 1
723
+ 49
724
+ 4
725
+ 1
726
+ 11
727
+ I
728
+ 3
729
+ I
730
+ 1
731
+ I
732
+ 1
733
+ I
734
+ 1
735
+ n
736
+ p
737
+ 5
738
+ x
739
+ 7
740
+ to_json
741
+ x
742
+ 11
743
+ respond_to?
744
+ x
745
+ 4
746
+ JSON
747
+ n
748
+ x
749
+ 7
750
+ unparse
751
+ p
752
+ 5
753
+ I
754
+ -1
755
+ I
756
+ 1f
757
+ I
758
+ 0
759
+ I
760
+ 20
761
+ I
762
+ 1d
763
+ x
764
+ 44
765
+ /Users/jcoglan/projects/primer/lib/primer.rb
766
+ p
767
+ 1
768
+ x
769
+ 6
770
+ object
771
+ x
772
+ 11
773
+ deserialize
774
+ M
775
+ 1
776
+ n
777
+ n
778
+ x
779
+ 11
780
+ deserialize
781
+ i
782
+ 12
783
+ 45
784
+ 0
785
+ 1
786
+ 20
787
+ 0
788
+ 49
789
+ 2
790
+ 1
791
+ 49
792
+ 3
793
+ 0
794
+ 11
795
+ I
796
+ 3
797
+ I
798
+ 1
799
+ I
800
+ 1
801
+ I
802
+ 1
803
+ n
804
+ p
805
+ 4
806
+ x
807
+ 4
808
+ JSON
809
+ n
810
+ x
811
+ 5
812
+ parse
813
+ x
814
+ 5
815
+ first
816
+ p
817
+ 5
818
+ I
819
+ -1
820
+ I
821
+ 23
822
+ I
823
+ 0
824
+ I
825
+ 24
826
+ I
827
+ c
828
+ x
829
+ 44
830
+ /Users/jcoglan/projects/primer/lib/primer.rb
831
+ p
832
+ 1
833
+ x
834
+ 6
835
+ string
836
+ p
837
+ 37
838
+ I
839
+ 2
840
+ I
841
+ 6
842
+ I
843
+ 19
844
+ I
845
+ 8
846
+ I
847
+ 26
848
+ I
849
+ 9
850
+ I
851
+ 33
852
+ I
853
+ b
854
+ I
855
+ 43
856
+ I
857
+ c
858
+ I
859
+ 53
860
+ I
861
+ d
862
+ I
863
+ 63
864
+ I
865
+ e
866
+ I
867
+ 73
868
+ I
869
+ f
870
+ I
871
+ 83
872
+ I
873
+ 10
874
+ I
875
+ 93
876
+ I
877
+ 11
878
+ I
879
+ a3
880
+ I
881
+ 12
882
+ I
883
+ b3
884
+ I
885
+ 13
886
+ I
887
+ c3
888
+ I
889
+ 15
890
+ I
891
+ df
892
+ I
893
+ 27
894
+ I
895
+ e0
896
+ I
897
+ 19
898
+ I
899
+ 103
900
+ I
901
+ 1b
902
+ I
903
+ 10e
904
+ I
905
+ 1f
906
+ I
907
+ 119
908
+ I
909
+ 23
910
+ I
911
+ 124
912
+ x
913
+ 44
914
+ /Users/jcoglan/projects/primer/lib/primer.rb
915
+ p
916
+ 0
917
+ x
918
+ 13
919
+ attach_method
920
+ p
921
+ 9
922
+ I
923
+ 0
924
+ I
925
+ 1
926
+ I
927
+ 9
928
+ I
929
+ 2
930
+ I
931
+ 12
932
+ I
933
+ 3
934
+ I
935
+ 1b
936
+ I
937
+ 5
938
+ I
939
+ 37
940
+ x
941
+ 44
942
+ /Users/jcoglan/projects/primer/lib/primer.rb
943
+ p
944
+ 0