camping-abingo 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. data/README +3 -0
  2. data/doc/classes/ABingoCampingPlugin.html +188 -0
  3. data/doc/classes/ABingoCampingPlugin.src/M000016.html +18 -0
  4. data/doc/classes/ABingoCampingPlugin.src/M000017.html +18 -0
  5. data/doc/classes/ABingoCampingPlugin.src/M000018.html +19 -0
  6. data/doc/classes/ABingoCampingPlugin.src/M000034.html +18 -0
  7. data/doc/classes/ABingoCampingPlugin.src/M000035.html +18 -0
  8. data/doc/classes/ABingoCampingPlugin.src/M000036.html +19 -0
  9. data/doc/classes/ABingoCampingPlugin/ABingo.html +121 -0
  10. data/doc/classes/ABingoCampingPlugin/Controllers.html +191 -0
  11. data/doc/classes/ABingoCampingPlugin/Controllers.src/M000022.html +18 -0
  12. data/doc/classes/ABingoCampingPlugin/Controllers.src/M000023.html +26 -0
  13. data/doc/classes/ABingoCampingPlugin/Controllers.src/M000040.html +18 -0
  14. data/doc/classes/ABingoCampingPlugin/Controllers.src/M000041.html +26 -0
  15. data/doc/classes/ABingoCampingPlugin/Filters.html +158 -0
  16. data/doc/classes/ABingoCampingPlugin/Filters.src/M000037.html +26 -0
  17. data/doc/classes/ABingoCampingPlugin/Filters.src/M000055.html +26 -0
  18. data/doc/classes/ABingoCampingPlugin/Helpers.html +372 -0
  19. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000024.html +18 -0
  20. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000025.html +19 -0
  21. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000026.html +18 -0
  22. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000027.html +18 -0
  23. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000028.html +36 -0
  24. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000029.html +28 -0
  25. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000030.html +18 -0
  26. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000031.html +48 -0
  27. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000032.html +32 -0
  28. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000033.html +18 -0
  29. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000034.html +26 -0
  30. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000035.html +20 -0
  31. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000036.html +18 -0
  32. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000042.html +18 -0
  33. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000043.html +19 -0
  34. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000044.html +18 -0
  35. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000045.html +18 -0
  36. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000046.html +36 -0
  37. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000047.html +28 -0
  38. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000048.html +18 -0
  39. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000049.html +48 -0
  40. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000050.html +32 -0
  41. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000051.html +18 -0
  42. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000052.html +26 -0
  43. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000053.html +20 -0
  44. data/doc/classes/ABingoCampingPlugin/Helpers.src/M000054.html +18 -0
  45. data/doc/classes/ABingoCampingPlugin/Models.html +208 -0
  46. data/doc/classes/ABingoCampingPlugin/Models.src/M000038.html +22 -0
  47. data/doc/classes/ABingoCampingPlugin/Models.src/M000039.html +39 -0
  48. data/doc/classes/ABingoCampingPlugin/Models.src/M000040.html +21 -0
  49. data/doc/classes/ABingoCampingPlugin/Models.src/M000056.html +22 -0
  50. data/doc/classes/ABingoCampingPlugin/Models.src/M000057.html +39 -0
  51. data/doc/classes/ABingoCampingPlugin/Models.src/M000058.html +21 -0
  52. data/doc/classes/ABingoCampingPlugin/Models/Alternative.html +181 -0
  53. data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000041.html +20 -0
  54. data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000042.html +21 -0
  55. data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000043.html +21 -0
  56. data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000059.html +20 -0
  57. data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000060.html +21 -0
  58. data/doc/classes/ABingoCampingPlugin/Models/Alternative.src/M000061.html +21 -0
  59. data/doc/classes/ABingoCampingPlugin/Models/Experiment.html +273 -0
  60. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000044.html +21 -0
  61. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000045.html +21 -0
  62. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000046.html +18 -0
  63. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000047.html +18 -0
  64. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000048.html +20 -0
  65. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000049.html +23 -0
  66. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000050.html +29 -0
  67. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000051.html +50 -0
  68. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000052.html +28 -0
  69. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000062.html +21 -0
  70. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000063.html +21 -0
  71. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000064.html +18 -0
  72. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000065.html +18 -0
  73. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000066.html +20 -0
  74. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000067.html +23 -0
  75. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000068.html +29 -0
  76. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000069.html +50 -0
  77. data/doc/classes/ABingoCampingPlugin/Models/Experiment.src/M000070.html +28 -0
  78. data/doc/classes/ABingoCampingPlugin/Views.html +196 -0
  79. data/doc/classes/ABingoCampingPlugin/Views.src/M000019.html +18 -0
  80. data/doc/classes/ABingoCampingPlugin/Views.src/M000020.html +18 -0
  81. data/doc/classes/ABingoCampingPlugin/Views.src/M000021.html +30 -0
  82. data/doc/classes/ABingoCampingPlugin/Views.src/M000037.html +18 -0
  83. data/doc/classes/ABingoCampingPlugin/Views.src/M000038.html +18 -0
  84. data/doc/classes/ABingoCampingPlugin/Views.src/M000039.html +30 -0
  85. data/doc/classes/Abingo.html +429 -0
  86. data/doc/classes/Abingo.src/M000001.html +18 -0
  87. data/doc/classes/Abingo.src/M000002.html +18 -0
  88. data/doc/classes/Abingo.src/M000003.html +18 -0
  89. data/doc/classes/Abingo.src/M000004.html +22 -0
  90. data/doc/classes/Abingo.src/M000005.html +69 -0
  91. data/doc/classes/Abingo.src/M000006.html +47 -0
  92. data/doc/classes/Abingo.src/M000007.html +31 -0
  93. data/doc/classes/Abingo.src/M000008.html +36 -0
  94. data/doc/classes/Abingo.src/M000009.html +18 -0
  95. data/doc/classes/Abingo.src/M000010.html +36 -0
  96. data/doc/classes/Abingo.src/M000011.html +22 -0
  97. data/doc/classes/Abingo.src/M000012.html +21 -0
  98. data/doc/classes/Abingo.src/M000013.html +18 -0
  99. data/doc/classes/Abingo.src/M000014.html +39 -0
  100. data/doc/classes/Abingo.src/M000015.html +25 -0
  101. data/doc/classes/ActiveSupport.html +107 -0
  102. data/doc/classes/ActiveSupport/Cache.html +111 -0
  103. data/doc/classes/ActiveSupport/Cache/MemoryStore.html +137 -0
  104. data/doc/classes/ActiveSupport/Cache/MemoryStore.src/M000016.html +18 -0
  105. data/doc/classes/CampingABingoTest.html +149 -0
  106. data/doc/classes/CampingABingoTest.src/M000017.html +24 -0
  107. data/doc/classes/CampingABingoTest/Controllers.html +116 -0
  108. data/doc/classes/CampingABingoTest/Controllers/Index.html +137 -0
  109. data/doc/classes/CampingABingoTest/Controllers/Index.src/M000024.html +18 -0
  110. data/doc/classes/CampingABingoTest/Controllers/Landing.html +137 -0
  111. data/doc/classes/CampingABingoTest/Controllers/Landing.src/M000026.html +18 -0
  112. data/doc/classes/CampingABingoTest/Controllers/SignIn.html +152 -0
  113. data/doc/classes/CampingABingoTest/Controllers/SignIn.src/M000030.html +18 -0
  114. data/doc/classes/CampingABingoTest/Controllers/SignIn.src/M000031.html +34 -0
  115. data/doc/classes/CampingABingoTest/Controllers/SignOut.html +137 -0
  116. data/doc/classes/CampingABingoTest/Controllers/SignOut.src/M000029.html +21 -0
  117. data/doc/classes/CampingABingoTest/Controllers/SignUp.html +152 -0
  118. data/doc/classes/CampingABingoTest/Controllers/SignUp.src/M000027.html +23 -0
  119. data/doc/classes/CampingABingoTest/Controllers/SignUp.src/M000028.html +33 -0
  120. data/doc/classes/CampingABingoTest/Controllers/Welcome.html +137 -0
  121. data/doc/classes/CampingABingoTest/Controllers/Welcome.src/M000025.html +18 -0
  122. data/doc/classes/CampingABingoTest/Helpers.html +112 -0
  123. data/doc/classes/CampingABingoTest/Models.html +119 -0
  124. data/doc/classes/CampingABingoTest/Models/CreateUserSchema.html +152 -0
  125. data/doc/classes/CampingABingoTest/Models/CreateUserSchema.src/M000032.html +26 -0
  126. data/doc/classes/CampingABingoTest/Models/CreateUserSchema.src/M000033.html +19 -0
  127. data/doc/classes/CampingABingoTest/Models/User.html +111 -0
  128. data/doc/classes/CampingABingoTest/Views.html +206 -0
  129. data/doc/classes/CampingABingoTest/Views.src/M000018.html +70 -0
  130. data/doc/classes/CampingABingoTest/Views.src/M000019.html +22 -0
  131. data/doc/classes/CampingABingoTest/Views.src/M000020.html +51 -0
  132. data/doc/classes/CampingABingoTest/Views.src/M000021.html +31 -0
  133. data/doc/classes/CampingABingoTest/Views.src/M000022.html +31 -0
  134. data/doc/classes/CampingABingoTest/Views.src/M000023.html +20 -0
  135. data/doc/created.rid +1 -0
  136. data/doc/files/examples/camping-abingo-test/camping-abingo-test_rb.html +101 -0
  137. data/doc/files/lib/camping-abingo_rb.html +457 -0
  138. data/doc/fr_class_index.html +52 -0
  139. data/doc/fr_file_index.html +28 -0
  140. data/doc/fr_method_index.html +96 -0
  141. data/doc/index.html +24 -0
  142. data/lib/camping-abingo.rb +1233 -0
  143. metadata +279 -0
@@ -0,0 +1,70 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>layout (CampingABingoTest::Views)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File examples/camping-abingo-test/camping-abingo-test.rb, line 166</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">layout</span>
15
+ <span class="ruby-identifier">html</span> <span class="ruby-keyword kw">do</span>
16
+
17
+ <span class="ruby-identifier">head</span> <span class="ruby-keyword kw">do</span>
18
+ <span class="ruby-identifier">title</span> <span class="ruby-value str">&quot;Ruby Camping ABingo Plugin Demo&quot;</span>
19
+
20
+ <span class="ruby-identifier">style</span> <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'text/css'</span> <span class="ruby-keyword kw">do</span>
21
+ <span class="ruby-value str">&quot;\n/* --- General Test App Styles --- */\n\nbody {\npadding:0 0 0 0;\nmargin:5px;\nfont-family:'Lucida Grande','Lucida Sans Unicode',sans-serif;\nfont-size: 0.8em;\ncolor:#303030;\nbackground-color: #fbf9b5;\n}\n\na {\ncolor:#303030;\ntext-decoration:none;\nborder-bottom:1px dotted #505050;\n}\n\na:hover {\ncolor:#303030;\nbackground: yellow;\ntext-decoration:none;\nborder-bottom:4px solid orange;\n}\n\nh1 {\nfont-size: 14px;\ncolor: #cc3300;\n}\n\ntable {\nfont-size:0.9em;\nwidth: 1050px;\n}\n\ntr\n{\nbackground:lightgoldenRodYellow;\nvertical-align:top;\n}\n\nth\n{\nfont-size: 0.9em;\nfont-weight:bold;\nbackground:lightBlue none repeat scroll 0 0;\n\ntext-align:left;\n}\n\n#header\n{\nwidth: 100%;\nheight: 30px;\nborder-bottom: 4px solid #ccc;\n}\n\n#header_title\n{\nfloat: left;\n}\n\n#top_nav\n{\nfloat: right;\n}\n\n#footer\n{\nwidth: 100%;\nborder-top: 4px solid #ccc;\n}\n\n\n#footer_notices\n{\nwidth: 100%;\nborder-top: 4px solid #ccc;\n}\n\n#home\n{\nbackground-color: #C9E3F5;\npadding: 10px;\nheight: 300px;\n}\n\n#debug_panel\n{\nbackground-color: wheat;\npadding: 10px;\n}\n\n.xyz\n{\nbackground-color: #D1F2A5;\npadding: 10px;\nheight: 300px;\n}\n\n.xyz h1\n{\ncolor: #9D9F89;\n}\n\n#special_promo\n{\nmargin: 20px;\n}\n\n#landing a:hover\n{\nbackground-color: #B2DE93;\nborder-bottom-color:green;\n}\n\n#marketing\n{\nwidth: 480px;\nheight: 100px;\nmargin: 20px;\n}\n\n#benefits\n{\nfloat: left;\nwidth: 300px;\nheight: 100px;\nfont-size: 1.3em;\nfont-weight: bold;\ncolor: green;\nbackground-color: #B2DE93;\n}\n\n#actnow\n{\nfloat: right;\nwidth: 180px;\nheight: 100px;\ntext-align: center;\nbackground-color: #8BC59B;\n}\n\n#signup_btn\n{\nbackground-color:#91F1A0;\nborder:4px solid green;\nfont-size:1.5em;\nfont-weight:bold;\nheight:72px;\nmargin: 10px 20px 10px 22px;\nwidth:130px;\n}\n\n#actnow a:hover #signup_btn\n{\nbackground-color: #69F17F;\ncolor: #007300;\nborder: 4px solid #00AA00;\n}\n\n/* --- ABingo Dashboard Styles ---*/\n\n#abingo_dashboard\n{\nbackground-color: white;\npadding: 10px;\n}\n\nabingo_experiment_table\n{\nwidth: 100%;\n}\n\n.abingo_experiment_row\n{\n}\n\n.abingo_alternative_row\n{\ncolor: red;\nfont-weight: bold;\n}\n\n.abingo_debug\n{\ndisplay: block;\nwidth: 100%;\n}\n\n.abingo_explain\n{\ncolor: #CCC;\nfont-style:italics;\n}\n\n\n&quot;</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#head</span>
24
+
25
+ <span class="ruby-identifier">body</span> <span class="ruby-keyword kw">do</span>
26
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">header!</span> <span class="ruby-keyword kw">do</span>
27
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">header_title!</span> <span class="ruby-value str">&quot;Ruby Camping ABingo Plugin Demo&quot;</span>
28
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">top_nav!</span> <span class="ruby-keyword kw">do</span>
29
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;Home&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;/&quot;</span>
30
+ <span class="ruby-identifier">span</span> <span class="ruby-value str">&quot; | &quot;</span>
31
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">user_id</span>.<span class="ruby-identifier">nil?</span>
32
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;Sign-In&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'/signin'</span>
33
+ <span class="ruby-identifier">span</span> <span class="ruby-value str">&quot; | &quot;</span>
34
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;Sign-Up&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'/signup'</span>
35
+ <span class="ruby-keyword kw">else</span>
36
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;XYZ&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;/welcome&quot;</span>
37
+ <span class="ruby-identifier">span</span> <span class="ruby-value str">&quot; | &quot;</span>
38
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;Sign-Out&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">'/signout'</span>
39
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@state</span>.<span class="ruby-identifier">user_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">abingo_administrator_user_id</span>
40
+ <span class="ruby-identifier">span</span> <span class="ruby-value str">&quot; | &quot;</span>
41
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;ABingo Dashboard&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;/abingo/dashboard&quot;</span>
42
+ <span class="ruby-keyword kw">end</span>
43
+ <span class="ruby-keyword kw">end</span>
44
+ <span class="ruby-keyword kw">end</span>
45
+ <span class="ruby-keyword kw">end</span>
46
+
47
+ <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">yield</span>
48
+
49
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">footer!</span> <span class="ruby-keyword kw">do</span>
50
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">debug_panel!</span> <span class="ruby-keyword kw">do</span>
51
+ <span class="ruby-identifier">h4</span> <span class="ruby-value str">&quot;Debugging Information:&quot;</span>
52
+ <span class="ruby-identifier">h5</span> <span class="ruby-value str">&quot;State:&quot;</span>
53
+ <span class="ruby-identifier">div</span> <span class="ruby-node">&quot;#{@state.inspect}&quot;</span>
54
+
55
+ <span class="ruby-identifier">h5</span> <span class="ruby-value str">&quot;Cache Data:&quot;</span>
56
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">cache</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">cache</span>.<span class="ruby-identifier">data</span>
57
+ <span class="ruby-constant">Abingo</span>.<span class="ruby-identifier">cache</span>.<span class="ruby-identifier">data</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span> <span class="ruby-operator">|</span>
58
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">abingo_debug</span> <span class="ruby-node">&quot;#{k} =&gt; #{v.inspect}&quot;</span>;
59
+ <span class="ruby-keyword kw">end</span>
60
+ <span class="ruby-keyword kw">end</span>
61
+ <span class="ruby-keyword kw">end</span>
62
+
63
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">footer_notices!</span> { <span class="ruby-node">&quot;Copyright &amp;copy; 2010 &amp;nbsp; - #{ a('Patrick McKenzie', :href =&gt; 'http://www.bingocardcreator.com/abingo') } and #{ a('Philippe Monnet', :href =&gt; 'http://blog.monnet-usa.com/') } &quot;</span> }
64
+ <span class="ruby-keyword kw">end</span>
65
+ <span class="ruby-keyword kw">end</span>
66
+
67
+ <span class="ruby-keyword kw">end</span>
68
+ <span class="ruby-keyword kw">end</span></pre>
69
+ </body>
70
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>index (CampingABingoTest::Views)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File examples/camping-abingo-test/camping-abingo-test.rb, line 422</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>
15
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">home!</span> <span class="ruby-keyword kw">do</span>
16
+ <span class="ruby-identifier">h1</span> <span class="ruby-value str">'My CampingABingoTest App'</span>
17
+
18
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;XYZ SAAS Application Landing page variations&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;/landing&quot;</span>; <span class="ruby-identifier">br</span>;
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>landing (CampingABingoTest::Views)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File examples/camping-abingo-test/camping-abingo-test.rb, line 430</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">landing</span>
15
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">xyz</span> <span class="ruby-keyword kw">do</span>
16
+ <span class="ruby-identifier">h1</span> <span class="ruby-value str">'XYZ SAAS Application'</span>
17
+
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ab_test</span>(<span class="ruby-value str">&quot;special_promo&quot;</span>)
19
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">special_promo!</span> <span class="ruby-keyword kw">do</span>
20
+ <span class="ruby-identifier">div</span> <span class="ruby-value str">&quot;Special offer for today only&quot;</span>
21
+ <span class="ruby-identifier">a</span> <span class="ruby-value str">&quot;Sign-Up Now and get a month free!&quot;</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;/signup?special_promo=1&quot;</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">else</span>
24
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">abingo_explain</span> <span class="ruby-value str">&quot;The special promo was not selected for this user&quot;</span>
25
+ <span class="ruby-keyword kw">end</span>
26
+
27
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">marketing!</span> <span class="ruby-keyword kw">do</span>
28
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">benefits!</span> <span class="ruby-keyword kw">do</span>
29
+ <span class="ruby-identifier">ul</span> <span class="ruby-keyword kw">do</span>
30
+ <span class="ruby-identifier">li</span> <span class="ruby-value str">&quot;Save XYZ time in half&quot;</span>
31
+ <span class="ruby-identifier">li</span> <span class="ruby-value str">&quot;Reduce XYZ cost by 25%&quot;</span>
32
+ <span class="ruby-identifier">li</span> <span class="ruby-value str">&quot;Improve quality&quot;</span>
33
+ <span class="ruby-keyword kw">end</span>
34
+ <span class="ruby-keyword kw">end</span>
35
+
36
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">actnow!</span> <span class="ruby-keyword kw">do</span>
37
+ <span class="ruby-identifier">signup_text</span> = <span class="ruby-identifier">ab_test</span>(<span class="ruby-value str">&quot;call_to_action&quot;</span>,
38
+ [ <span class="ruby-value str">&quot;Sign-Up Now!&quot;</span>,
39
+ <span class="ruby-value str">&quot;Try It For Free Now!&quot;</span>,
40
+ <span class="ruby-value str">&quot;Start Your Free Trial Now!&quot;</span>,
41
+ ])
42
+
43
+ <span class="ruby-identifier">a</span> <span class="ruby-identifier">:href=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;/signup&quot;</span> <span class="ruby-keyword kw">do</span>
44
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">signup_btn!</span> <span class="ruby-identifier">signup_text</span>
45
+ <span class="ruby-keyword kw">end</span>
46
+ <span class="ruby-keyword kw">end</span>
47
+ <span class="ruby-keyword kw">end</span>
48
+ <span class="ruby-keyword kw">end</span>
49
+ <span class="ruby-keyword kw">end</span></pre>
50
+ </body>
51
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>signin (CampingABingoTest::Views)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File examples/camping-abingo-test/camping-abingo-test.rb, line 467</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">signin</span>
15
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">xyz</span> <span class="ruby-keyword kw">do</span>
16
+ <span class="ruby-identifier">h1</span> <span class="ruby-value str">'XYZ SAAS Application Sign-In'</span>
17
+ <span class="ruby-identifier">div</span> <span class="ruby-ivar">@info</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@info</span>
18
+
19
+ <span class="ruby-identifier">form</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">R</span>(<span class="ruby-constant">SignIn</span>), <span class="ruby-identifier">:method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'post'</span> <span class="ruby-keyword kw">do</span>
20
+ <span class="ruby-identifier">label</span> <span class="ruby-value str">'Username'</span>, <span class="ruby-identifier">:for</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'username'</span>; <span class="ruby-identifier">br</span>
21
+ <span class="ruby-identifier">input</span> <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'username'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'text'</span>; <span class="ruby-identifier">br</span>
22
+
23
+ <span class="ruby-identifier">label</span> <span class="ruby-value str">'Password'</span>, <span class="ruby-identifier">:for</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'password'</span>; <span class="ruby-identifier">br</span>
24
+ <span class="ruby-identifier">input</span> <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'password'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'text'</span>; <span class="ruby-identifier">br</span>
25
+
26
+ <span class="ruby-identifier">input</span> <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'submit'</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'signin'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Sign-In'</span>
27
+ <span class="ruby-keyword kw">end</span>
28
+ <span class="ruby-keyword kw">end</span>
29
+ <span class="ruby-keyword kw">end</span></pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>signup (CampingABingoTest::Views)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File examples/camping-abingo-test/camping-abingo-test.rb, line 484</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">signup</span>
15
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">xyz</span> <span class="ruby-keyword kw">do</span>
16
+ <span class="ruby-identifier">h1</span> <span class="ruby-value str">'XYZ SAAS Application Sign-Up'</span>
17
+ <span class="ruby-identifier">div</span> <span class="ruby-ivar">@info</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@info</span>
18
+
19
+ <span class="ruby-identifier">form</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">R</span>(<span class="ruby-constant">SignUp</span>), <span class="ruby-identifier">:method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'post'</span> <span class="ruby-keyword kw">do</span>
20
+ <span class="ruby-identifier">label</span> <span class="ruby-value str">'Username'</span>, <span class="ruby-identifier">:for</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'username'</span>; <span class="ruby-identifier">br</span>
21
+ <span class="ruby-identifier">input</span> <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'username'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'text'</span>; <span class="ruby-identifier">br</span>
22
+
23
+ <span class="ruby-identifier">label</span> <span class="ruby-value str">'Password'</span>, <span class="ruby-identifier">:for</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'password'</span>; <span class="ruby-identifier">br</span>
24
+ <span class="ruby-identifier">input</span> <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'password'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'password'</span>; <span class="ruby-identifier">br</span>;<span class="ruby-identifier">br</span>
25
+
26
+ <span class="ruby-identifier">input</span> <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'submit'</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'signup'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Sign-Up'</span>
27
+ <span class="ruby-keyword kw">end</span>
28
+ <span class="ruby-keyword kw">end</span>
29
+ <span class="ruby-keyword kw">end</span></pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>welcome (CampingABingoTest::Views)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File examples/camping-abingo-test/camping-abingo-test.rb, line 501</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">welcome</span>
15
+ <span class="ruby-identifier">div</span>.<span class="ruby-identifier">xyz</span> <span class="ruby-keyword kw">do</span>
16
+ <span class="ruby-identifier">h1</span> <span class="ruby-value str">'Welcome'</span>
17
+ <span class="ruby-keyword kw">end</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1 @@
1
+ Sun, 28 Nov 2010 11:05:56 -0700
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: camping-abingo-test.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>camping-abingo-test.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>examples/camping-abingo-test/camping-abingo-test.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sat Nov 27 12:34:18 -0700 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,457 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: camping-abingo.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>camping-abingo.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/camping-abingo.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Nov 28 10:58:07 -0700 2010</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ [<a
74
+ href="../../classes/Abingo.html">Abingo</a>|identity|flip();test();bingo!(){bg:red}]
75
+ [Experiment|test_name;status|start_experiment!();end_experiment!(){bg:green}]
76
+ [Alternative|content;lookup;weight;participants;conversions|score_conversion();score_participation(){bg:yellow}]
77
+ [User|id;username{bg:blue}] [<a
78
+ href="../../classes/Abingo.html">Abingo</a>]uses -.-&gt;[Experiment] [<a
79
+ href="../../classes/Abingo.html">Abingo</a>]-id&gt;[User]
80
+ [Experiment]++1-alternatives &gt;*[Alternative]
81
+ </p>
82
+ <table>
83
+ <tr><td valign="top">Author:</td><td>Philippe F. Monnet (<a
84
+ href="mailto:pfmonnet@gmail.com">pfmonnet@gmail.com</a>)
85
+
86
+ </td></tr>
87
+ <tr><td valign="top">Copyright:</td><td>Copyright (c) 2010 Philippe F. Monnet - ABingo Camping plugin
88
+
89
+ </td></tr>
90
+ <tr><td valign="top">Copyright:</td><td>Copyright (c) 2009 Patrick McKenzie - A subset of the Rails ABingo plugin
91
+ reused in ABingo Camping
92
+
93
+ </td></tr>
94
+ <tr><td valign="top">License:</td><td>Distributes under the same terms as Ruby
95
+
96
+ </td></tr>
97
+ <tr><td valign="top">Version:</td><td>1.0.3
98
+
99
+ </td></tr>
100
+ </table>
101
+ <h1>Installing Camping-ABingo</h1>
102
+ <p>
103
+ A lightweight ABingo plugin for Ruby Camping. To install the library and
104
+ its prerequisisites, type the following command(s):
105
+ </p>
106
+ <pre>
107
+ $ gem install camping-abingo
108
+ </pre>
109
+ <h1>Adding ABingo Provider Support To Your App</h1>
110
+ <h3>Add new gem and require statements</h3>
111
+ <p>
112
+ Add the following statements towards the top of your source file (before
113
+ the Camping.goes statement):
114
+ </p>
115
+ <pre>
116
+ gem 'camping' , '&gt;= 2.0'
117
+ gem 'filtering_camping' , '&gt;= 1.0'
118
+
119
+ %w(rubygems active_record erb fileutils json markaby md5 redcloth
120
+ camping camping/session filtering_camping camping-abingo
121
+ ).each { |lib| require lib }
122
+ </pre>
123
+ <h3>Customizing the main module</h3>
124
+ <p>
125
+ First we&#8216;ll make sure to include the Camping::Session and
126
+ CampingFilters modules, and to extend the app module with <a
127
+ href="../../classes/ABingoCampingPlugin.html">ABingoCampingPlugin</a>, like
128
+ so:
129
+ </p>
130
+ <pre>
131
+ module CampingABingoTest
132
+ include Camping::Session
133
+ include CampingFilters
134
+
135
+ extend ABingoCampingPlugin
136
+ include ABingoCampingPlugin::Filters
137
+
138
+ # ...
139
+ end
140
+ </pre>
141
+ <p>
142
+ This gives us the ability to leverage a logger for the camping-abingo
143
+ plugin.
144
+ </p>
145
+ <pre>
146
+ app_logger = Logger.new(File.dirname(__FILE__) + '/camping-abingo-test.log')
147
+ app_logger.level = Logger::DEBUG
148
+ Camping::Models::Base.logger = app_logger
149
+ ABingoCampingPlugin.logger = app_logger
150
+ </pre>
151
+ <p>
152
+ Now let&#8216;s customize the create method by adding a call to <a
153
+ href="../../classes/ABingoCampingPlugin.html#M000036">ABingoCampingPlugin.create</a>,
154
+ so we can give the plugin to run any needed initialization (such as running
155
+ the ABingo-specific ActiveRecord migration).
156
+ </p>
157
+ <pre>
158
+ def CampingABingoTest.create
159
+ ABingoCampingPlugin.create
160
+ end
161
+ </pre>
162
+ <p>
163
+ Also if you plan on using the ABingo dashboard to view the statistics, you
164
+ need to define the user id associated with the administrator:
165
+ </p>
166
+ <pre>
167
+ Abingo.options[:abingo_administrator_user_id] = 1 #change this id to match the account id you need
168
+ </pre>
169
+ <p>
170
+ Ok, at this point we have a minimally configured application module. Our
171
+ next step is to move on to the Models module.
172
+ </p>
173
+ <h3>Plugging in the ABingo models</h3>
174
+ <p>
175
+ First, we&#8216;ll include the include <a
176
+ href="../../classes/ABingoCampingPlugin/Models.html">ABingoCampingPlugin::Models</a>
177
+ module so we can get all the ABingo-specific models. Then we&#8216;ll
178
+ define a User model. The User will need to keep track of the applications
179
+ it provided access to. It will also manage the tokens associated with these
180
+ applications. Our model will look like this:
181
+ </p>
182
+ <pre>
183
+ class User &lt; Base;
184
+ has_many :client_applications
185
+ has_many :tokens,
186
+ :class_name=&gt;&quot;OauthToken&quot;,
187
+ :order=&gt;&quot;authorized_at desc&quot;,
188
+ :include=&gt;[:client_application]
189
+
190
+ end
191
+ </pre>
192
+ <p>
193
+ Now we need a CreateUserSchema migration class to define our database
194
+ tables for User, and ABingo models. In the up and down methods we will
195
+ plugin a call to the corresponding method from the <a
196
+ href="../../classes/ABingoCampingPlugin/Models.html">ABingoCampingPlugin::Models</a>
197
+ module to create the tables for the Experiment and Alternative models.
198
+ </p>
199
+ <pre>
200
+ class CreateUserSchema &lt; V 1.0
201
+ def self.up
202
+ create_table :CampingABingoTest_users, :force =&gt; true do |t|
203
+ t.integer :id, :null =&gt; false
204
+ t.string :username
205
+ t.string :password
206
+ end
207
+
208
+ User.create :username =&gt; 'admin', :password =&gt; 'camping'
209
+
210
+ ABingoCampingPlugin::Models.up
211
+ end
212
+
213
+ def self.down
214
+ ABingoCampingPlugin::Models.down
215
+
216
+ drop_table :CampingABingoTest_users
217
+ end
218
+ end
219
+ </pre>
220
+ <p>
221
+ At this point we can go back to the main module and add the code to
222
+ configure the ActiveRecord connection and invoke our new schema migration
223
+ if the User table does not exist yet. This code will be added to the create
224
+ method:
225
+ </p>
226
+ <pre>
227
+ module CampingABingoTest
228
+ # ...
229
+
230
+ def CampingABingoTest.create
231
+ dbconfig = YAML.load(File.read('config/database.yml'))
232
+ Camping::Models::Base.establish_connection dbconfig['development']
233
+
234
+ ABingoCampingPlugin.create
235
+ Abingo.cache.logger = Camping::Models::Base.logger
236
+ Abingo.options[:abingo_administrator_user_id] = 1
237
+
238
+ CampingABingoTest::Models.create_schema :assume =&gt; (CampingABingoTest::Models::User.table_exists? ? 1.1 : 0.0)
239
+ end
240
+ end
241
+ </pre>
242
+ <p>
243
+ You probably noticed that the database configuration is loaded from a
244
+ database.yml file. So let&#8216;s create a subfolder named config and a
245
+ file named database.yml, then let&#8216;s configure the yaml file as
246
+ follows:
247
+ </p>
248
+ <pre>
249
+ development:
250
+ adapter: sqlite3
251
+ database: camping-abingo-test.db
252
+ </pre>
253
+ <p>
254
+ Now if we restart the application, our migration should be executed.
255
+ </p>
256
+ <h3>Creating a common helpers module</h3>
257
+ <p>
258
+ The Helpers module is used in Camping to provide common utilities to both
259
+ the Controllers and Views modules. Enhancing our Helpers module is very
260
+ easy, we need to add both and extend and an include of the <a
261
+ href="../../classes/ABingoCampingPlugin/Helpers.html">ABingoCampingPlugin::Helpers</a>
262
+ module so we can enhance both instance and class sides:
263
+ </p>
264
+ <pre>
265
+ module CampingABingoTest::Helpers
266
+ extend ABingoCampingPlugin::Helpers
267
+ include ABingoCampingPlugin::Helpers
268
+ end
269
+ </pre>
270
+ <h3>Plugging in the ABingo controllers</h3>
271
+ <p>
272
+ We will need to extend our app Controllers module with the <a
273
+ href="../../classes/ABingoCampingPlugin/Controllers.html">ABingoCampingPlugin::Controllers</a>
274
+ module using the extend statement. Then just before the end of the
275
+ Controllers module, we&#8216;ll add a call to the
276
+ include_abingo_controllers method. This is how camping-abingo will inject
277
+ and plugin the common ABingo controllers and helpers. It is important that
278
+ this call always remain the last statement of the module, even when you add
279
+ new controller classes. So the module should look like so:
280
+ </p>
281
+ <pre>
282
+ module CampingABingoTest::Controllers
283
+ extend ABingoCampingPlugin::Controllers
284
+
285
+ # ...
286
+
287
+ include_abingo_controllers
288
+ end #Controllers
289
+ </pre>
290
+ <p>
291
+ Before we continue fleshing out the logic of our controllers, let&#8216;s
292
+ finish hooking up the Views module.
293
+ </p>
294
+ <h3>Plugging in the ABingo common views</h3>
295
+ <p>
296
+ We will need to extend our app Views module with the <a
297
+ href="../../classes/ABingoCampingPlugin/Views.html">ABingoCampingPlugin::Views</a>
298
+ module using the extend statement. Then just before the end of the Views
299
+ module, we&#8216;ll add a call to the include_abingo_views method. This is
300
+ how camping-abingo will inject and plugin the common ABingo views. It is
301
+ important that this call always remain the last statement of the module,
302
+ even when you add new view methods. So the module should look like so:
303
+ </p>
304
+ <pre>
305
+ module CampingABingoTest::Views
306
+ extend ABingoCampingPlugin::Views
307
+
308
+ # ...
309
+
310
+ include_abingo_views
311
+ end
312
+ </pre>
313
+ <h2>Testing And Troubleshooting</h2>
314
+ <p>
315
+ At this stage, we have a basic Camping ABingo Tester, now let&#8216;s test
316
+ it! Run:
317
+ </p>
318
+ <pre>
319
+ camping --port 3301 camping-abingo-test.rb
320
+ </pre>
321
+ <p>
322
+ The migrations for both our test app and the plugin will be run. So at this
323
+ point you should see 3 tables:
324
+ </p>
325
+ <ul>
326
+ <li>abingo_alternatives
327
+
328
+ </li>
329
+ <li>abingo_experiments
330
+
331
+ </li>
332
+ <li>CampingABingoTest_users
333
+
334
+ </li>
335
+ </ul>
336
+ <h3>Test App</h3>
337
+ <p>
338
+ I suggest you test the app using FireFox with the Firebug and Firecookie
339
+ activated. This will make troubleshooting much easier.
340
+ </p>
341
+ <p>
342
+ Navigate to:
343
+ </p>
344
+ <pre>
345
+ http://localhost:3301/
346
+ </pre>
347
+ <p>
348
+ Notice in the Debugging Information panel of the page that <a
349
+ href="../../classes/Abingo.html">Abingo</a> assigned a state variable named
350
+ abingo_identity with a random value. Click on the &quot;XYZ SAAS
351
+ Application Landing page variations&quot; link. This page contains 2
352
+ variable content areas:
353
+ </p>
354
+ <ul>
355
+ <li>The &quot;special_promo&quot; div content
356
+
357
+ </li>
358
+ <li>The &quot;signup_btn&quot; button text
359
+
360
+ </li>
361
+ </ul>
362
+ <p>
363
+ <a href="../../classes/Abingo.html">Abingo</a> will randomly select an
364
+ alternative for each area. Once you click on the sign up button, ABingo
365
+ will track the conversion.
366
+ </p>
367
+ <p>
368
+ Now, using Firecookie, delete the campingabingotest.state cookie. And go
369
+ back to the main page. Notice that the abingo_identity has changed. You can
370
+ repeat the scenario and probably will get different results.
371
+ </p>
372
+ <h3>Dashboard</h3>
373
+ <p>
374
+ If you had created a test account and logged in, the sign-out and sign back
375
+ in as the administrator of the test app (admin/camping)/ You should now see
376
+ an &quot;ABingo Dashboard&quot; option on the top navigation. Click on it
377
+ or navigate to:
378
+ </p>
379
+ <pre>
380
+ http://localhost:3301/abingo/dashboard
381
+ </pre>
382
+ <p>
383
+ You should see two experiments:
384
+ </p>
385
+ <ul>
386
+ <li>Special Promo
387
+
388
+ </li>
389
+ <li>Call To Action
390
+
391
+ </li>
392
+ </ul>
393
+ <p>
394
+ For each experiment you can see the various alternatives and their
395
+ associated number of participants and conversions.There is also a summary
396
+ of the experiment. If you want to terminate an experiment click on the
397
+ corresponding link in the far right column.
398
+ </p>
399
+ <h3>Examples Source Code</h3>
400
+ <p>
401
+ Under the examples/camping-abingo-test you will find the full source for
402
+ the <a href="../../classes/CampingABingoTest.html">CampingABingoTest</a>
403
+ app.
404
+ </p>
405
+ <h1>More information</h1>
406
+ <p>
407
+ Check for updates :
408
+ </p>
409
+ <ul>
410
+ <li><a href="http://blog.monnet-usa.com">blog.monnet-usa.com</a>
411
+
412
+ </li>
413
+ <li><a
414
+ href="https://github.com/techarch/camping-abingo">github.com/techarch/camping-abingo</a>
415
+
416
+ </li>
417
+ </ul>
418
+
419
+ </div>
420
+
421
+ <div id="requires-list">
422
+ <h3 class="section-bar">Required files</h3>
423
+
424
+ <div class="name-list">
425
+ active_record&nbsp;&nbsp;
426
+ </div>
427
+ </div>
428
+
429
+ </div>
430
+
431
+
432
+ </div>
433
+
434
+
435
+ <!-- if includes -->
436
+
437
+ <div id="section">
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+ <!-- if method_list -->
447
+
448
+
449
+ </div>
450
+
451
+
452
+ <div id="validator-badges">
453
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
454
+ </div>
455
+
456
+ </body>
457
+ </html>