camping-abingo 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/ABingoCampingPlugin.html +16 -16
- data/doc/classes/ABingoCampingPlugin/Controllers.html +10 -10
- data/doc/classes/ABingoCampingPlugin/Filters.html +5 -5
- data/doc/classes/ABingoCampingPlugin/Helpers.html +65 -65
- data/doc/classes/ABingoCampingPlugin/Models.html +15 -15
- data/doc/classes/ABingoCampingPlugin/Models/Alternative.html +15 -15
- data/doc/classes/ABingoCampingPlugin/Models/Experiment.html +45 -45
- data/doc/classes/ABingoCampingPlugin/Views.html +15 -15
- data/doc/classes/ActiveSupport/Cache/MemoryStore.html +5 -5
- data/doc/classes/ActiveSupport/Cache/MemoryStore.src/M000001.html +18 -0
- data/doc/classes/CampingABingoTest.html +6 -6
- data/doc/classes/CampingABingoTest.src/M000002.html +24 -0
- data/doc/classes/CampingABingoTest/Controllers/Index.html +5 -5
- data/doc/classes/CampingABingoTest/Controllers/Index.src/M000009.html +18 -0
- data/doc/classes/CampingABingoTest/Controllers/Landing.html +5 -5
- data/doc/classes/CampingABingoTest/Controllers/Landing.src/M000011.html +18 -0
- data/doc/classes/CampingABingoTest/Controllers/SignIn.html +10 -10
- data/doc/classes/CampingABingoTest/Controllers/SignIn.src/M000015.html +18 -0
- data/doc/classes/CampingABingoTest/Controllers/SignIn.src/M000016.html +34 -0
- data/doc/classes/CampingABingoTest/Controllers/SignOut.html +5 -5
- data/doc/classes/CampingABingoTest/Controllers/SignOut.src/M000014.html +21 -0
- data/doc/classes/CampingABingoTest/Controllers/SignUp.html +10 -10
- data/doc/classes/CampingABingoTest/Controllers/SignUp.src/M000012.html +23 -0
- data/doc/classes/CampingABingoTest/Controllers/SignUp.src/M000013.html +33 -0
- data/doc/classes/CampingABingoTest/Controllers/Welcome.html +5 -5
- data/doc/classes/CampingABingoTest/Controllers/Welcome.src/M000010.html +18 -0
- data/doc/classes/CampingABingoTest/Helpers.html +1 -1
- data/doc/classes/CampingABingoTest/Models.html +1 -1
- data/doc/classes/CampingABingoTest/Models/CreateUserSchema.html +11 -11
- data/doc/classes/CampingABingoTest/Models/CreateUserSchema.src/M000017.html +26 -0
- data/doc/classes/CampingABingoTest/Models/CreateUserSchema.src/M000018.html +19 -0
- data/doc/classes/CampingABingoTest/Views.html +30 -30
- data/doc/classes/CampingABingoTest/Views.src/M000003.html +70 -0
- data/doc/classes/CampingABingoTest/Views.src/M000004.html +22 -0
- data/doc/classes/CampingABingoTest/Views.src/M000005.html +51 -0
- data/doc/classes/CampingABingoTest/Views.src/M000006.html +31 -0
- data/doc/classes/CampingABingoTest/Views.src/M000007.html +31 -0
- data/doc/classes/CampingABingoTest/Views.src/M000008.html +20 -0
- data/doc/created.rid +1 -1
- data/doc/files/examples/camping-abingo-test/camping-abingo-test_rb.html +1 -1
- data/doc/files/lib/camping-abingo_rb.html +3 -4
- data/doc/fr_class_index.html +0 -10
- data/doc/fr_file_index.html +0 -1
- data/doc/fr_method_index.html +18 -70
- data/examples/camping-abingo-test/camping-abingo-test-skeleton.rb +456 -0
- data/examples/camping-abingo-test/camping-abingo-test.rb +510 -0
- data/examples/camping-abingo-test/config.ru +26 -0
- data/examples/camping-abingo-test/config/database.yml +4 -0
- data/lib/camping-abingo.rb +1 -10
- metadata +50 -18
@@ -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">"Ruby Camping ABingo Plugin Demo"</span>
|
19
|
+
|
20
|
+
<span class="ruby-identifier">style</span> <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'text/css'</span> <span class="ruby-keyword kw">do</span>
|
21
|
+
<span class="ruby-value str">"\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"</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">"Ruby Camping ABingo Plugin Demo"</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">"Home"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">"/"</span>
|
30
|
+
<span class="ruby-identifier">span</span> <span class="ruby-value str">" | "</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">"Sign-In"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">'/signin'</span>
|
33
|
+
<span class="ruby-identifier">span</span> <span class="ruby-value str">" | "</span>
|
34
|
+
<span class="ruby-identifier">a</span> <span class="ruby-value str">"Sign-Up"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></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">"XYZ"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">"/welcome"</span>
|
37
|
+
<span class="ruby-identifier">span</span> <span class="ruby-value str">" | "</span>
|
38
|
+
<span class="ruby-identifier">a</span> <span class="ruby-value str">"Sign-Out"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></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">" | "</span>
|
41
|
+
<span class="ruby-identifier">a</span> <span class="ruby-value str">"ABingo Dashboard"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">"/abingo/dashboard"</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"><<</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">"Debugging Information:"</span>
|
52
|
+
<span class="ruby-identifier">h5</span> <span class="ruby-value str">"State:"</span>
|
53
|
+
<span class="ruby-identifier">div</span> <span class="ruby-node">"#{@state.inspect}"</span>
|
54
|
+
|
55
|
+
<span class="ruby-identifier">h5</span> <span class="ruby-value str">"Cache Data:"</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">&&</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">"#{k} => #{v.inspect}"</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">"Copyright &copy; 2010 &nbsp; - #{ a('Patrick McKenzie', :href => 'http://www.bingocardcreator.com/abingo') } and #{ a('Philippe Monnet', :href => 'http://blog.monnet-usa.com/') } "</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">"XYZ SAAS Application Landing page variations"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">"/landing"</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">"special_promo"</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">"Special offer for today only"</span>
|
21
|
+
<span class="ruby-identifier">a</span> <span class="ruby-value str">"Sign-Up Now and get a month free!"</span>, <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">"/signup?special_promo=1"</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">"The special promo was not selected for this user"</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">"Save XYZ time in half"</span>
|
31
|
+
<span class="ruby-identifier">li</span> <span class="ruby-value str">"Reduce XYZ cost by 25%"</span>
|
32
|
+
<span class="ruby-identifier">li</span> <span class="ruby-value str">"Improve quality"</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">"call_to_action"</span>,
|
38
|
+
[ <span class="ruby-value str">"Sign-Up Now!"</span>,
|
39
|
+
<span class="ruby-value str">"Try It For Free Now!"</span>,
|
40
|
+
<span class="ruby-value str">"Start Your Free Trial Now!"</span>,
|
41
|
+
])
|
42
|
+
|
43
|
+
<span class="ruby-identifier">a</span> <span class="ruby-identifier">:href=</span><span class="ruby-operator">></span><span class="ruby-value str">"/signup"</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">></span> <span class="ruby-constant">R</span>(<span class="ruby-constant">SignIn</span>), <span class="ruby-identifier">:method</span> =<span class="ruby-operator">></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">></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">></span> <span class="ruby-value str">'username'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></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">></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">></span> <span class="ruby-value str">'password'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></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">></span> <span class="ruby-value str">'submit'</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'signin'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></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">></span> <span class="ruby-constant">R</span>(<span class="ruby-constant">SignUp</span>), <span class="ruby-identifier">:method</span> =<span class="ruby-operator">></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">></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">></span> <span class="ruby-value str">'username'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></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">></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">></span> <span class="ruby-value str">'password'</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></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">></span> <span class="ruby-value str">'submit'</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'signup'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></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>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Mon, 06 Dec 2010 21:38:10 -0700
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Sat Dec 04 15:25:49 -0700 2010</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -150,7 +150,7 @@ plugin.
|
|
150
150
|
</pre>
|
151
151
|
<p>
|
152
152
|
Now let‘s customize the create method by adding a call to <a
|
153
|
-
href="../../classes/ABingoCampingPlugin.html#
|
153
|
+
href="../../classes/ABingoCampingPlugin.html#M000018">ABingoCampingPlugin.create</a>,
|
154
154
|
so we can give the plugin to run any needed initialization (such as running
|
155
155
|
the ABingo-specific ActiveRecord migration).
|
156
156
|
</p>
|
@@ -399,8 +399,7 @@ corresponding link in the far right column.
|
|
399
399
|
<h3>Examples Source Code</h3>
|
400
400
|
<p>
|
401
401
|
Under the examples/camping-abingo-test you will find the full source for
|
402
|
-
the
|
403
|
-
app.
|
402
|
+
the CampingABingoTest app.
|
404
403
|
</p>
|
405
404
|
<h1>More information</h1>
|
406
405
|
<p>
|
data/doc/fr_class_index.html
CHANGED
@@ -20,16 +20,6 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Classes</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/ABingoCampingPlugin.html">ABingoCampingPlugin</a><br />
|
24
|
-
<a href="classes/ABingoCampingPlugin/ABingo.html">ABingoCampingPlugin::ABingo</a><br />
|
25
|
-
<a href="classes/ABingoCampingPlugin/Controllers.html">ABingoCampingPlugin::Controllers</a><br />
|
26
|
-
<a href="classes/ABingoCampingPlugin/Filters.html">ABingoCampingPlugin::Filters</a><br />
|
27
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html">ABingoCampingPlugin::Helpers</a><br />
|
28
|
-
<a href="classes/ABingoCampingPlugin/Models.html">ABingoCampingPlugin::Models</a><br />
|
29
|
-
<a href="classes/ABingoCampingPlugin/Models/Alternative.html">ABingoCampingPlugin::Models::Alternative</a><br />
|
30
|
-
<a href="classes/ABingoCampingPlugin/Models/Experiment.html">ABingoCampingPlugin::Models::Experiment</a><br />
|
31
|
-
<a href="classes/ABingoCampingPlugin/Views.html">ABingoCampingPlugin::Views</a><br />
|
32
|
-
<a href="classes/Abingo.html">Abingo</a><br />
|
33
23
|
<a href="classes/ActiveSupport.html">ActiveSupport</a><br />
|
34
24
|
<a href="classes/ActiveSupport/Cache.html">ActiveSupport::Cache</a><br />
|
35
25
|
<a href="classes/ActiveSupport/Cache/MemoryStore.html">ActiveSupport::Cache::MemoryStore</a><br />
|
data/doc/fr_file_index.html
CHANGED
@@ -21,7 +21,6 @@
|
|
21
21
|
<h1 class="section-bar">Files</h1>
|
22
22
|
<div id="index-entries">
|
23
23
|
<a href="files/examples/camping-abingo-test/camping-abingo-test_rb.html">examples/camping-abingo-test/camping-abingo-test.rb</a><br />
|
24
|
-
<a href="files/lib/camping-abingo_rb.html">lib/camping-abingo.rb</a><br />
|
25
24
|
</div>
|
26
25
|
</div>
|
27
26
|
</body>
|
data/doc/fr_method_index.html
CHANGED
@@ -20,76 +20,24 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/
|
24
|
-
<a href="classes/
|
25
|
-
<a href="classes/
|
26
|
-
<a href="classes/
|
27
|
-
<a href="classes/
|
28
|
-
<a href="classes/
|
29
|
-
<a href="classes/
|
30
|
-
<a href="classes/
|
31
|
-
<a href="classes/
|
32
|
-
<a href="classes/
|
33
|
-
<a href="classes/
|
34
|
-
<a href="classes/
|
35
|
-
<a href="classes/
|
36
|
-
<a href="classes/
|
37
|
-
<a href="classes/
|
38
|
-
<a href="classes/
|
39
|
-
<a href="classes/
|
40
|
-
<a href="classes/CampingABingoTest.html#
|
41
|
-
<a href="classes/ABingoCampingPlugin.html#M000036">create (ABingoCampingPlugin)</a><br />
|
42
|
-
<a href="classes/ActiveSupport/Cache/MemoryStore.html#M000016">data (ActiveSupport::Cache::MemoryStore)</a><br />
|
43
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000049">describe_result_in_words (ABingoCampingPlugin::Helpers)</a><br />
|
44
|
-
<a href="classes/ABingoCampingPlugin/Models.html#M000058">down (ABingoCampingPlugin::Models)</a><br />
|
45
|
-
<a href="classes/CampingABingoTest/Models/CreateUserSchema.html#M000033">down (CampingABingoTest::Models::CreateUserSchema)</a><br />
|
46
|
-
<a href="classes/ABingoCampingPlugin/Models/Experiment.html#M000070">end_experiment! (ABingoCampingPlugin::Models::Experiment)</a><br />
|
47
|
-
<a href="classes/ABingoCampingPlugin/Models/Experiment.html#M000067">exists? (ABingoCampingPlugin::Models::Experiment)</a><br />
|
48
|
-
<a href="classes/Abingo.html#M000015">expires_in (Abingo)</a><br />
|
49
|
-
<a href="classes/Abingo.html#M000012">find_alternative_for_user (Abingo)</a><br />
|
50
|
-
<a href="classes/Abingo.html#M000004">flip (Abingo)</a><br />
|
51
|
-
<a href="classes/CampingABingoTest/Controllers/Landing.html#M000026">get (CampingABingoTest::Controllers::Landing)</a><br />
|
52
|
-
<a href="classes/CampingABingoTest/Controllers/SignIn.html#M000030">get (CampingABingoTest::Controllers::SignIn)</a><br />
|
53
|
-
<a href="classes/CampingABingoTest/Controllers/SignUp.html#M000027">get (CampingABingoTest::Controllers::SignUp)</a><br />
|
54
|
-
<a href="classes/CampingABingoTest/Controllers/Index.html#M000024">get (CampingABingoTest::Controllers::Index)</a><br />
|
55
|
-
<a href="classes/CampingABingoTest/Controllers/SignOut.html#M000029">get (CampingABingoTest::Controllers::SignOut)</a><br />
|
56
|
-
<a href="classes/CampingABingoTest/Controllers/Welcome.html#M000025">get (CampingABingoTest::Controllers::Welcome)</a><br />
|
57
|
-
<a href="classes/Abingo.html#M000008">human! (Abingo)</a><br />
|
58
|
-
<a href="classes/Abingo.html#M000003">identity (Abingo)</a><br />
|
59
|
-
<a href="classes/Abingo.html#M000002">identity= (Abingo)</a><br />
|
60
|
-
<a href="classes/ABingoCampingPlugin/Controllers.html#M000041">include_abingo_controllers (ABingoCampingPlugin::Controllers)</a><br />
|
61
|
-
<a href="classes/ABingoCampingPlugin/Views.html#M000039">include_abingo_views (ABingoCampingPlugin::Views)</a><br />
|
62
|
-
<a href="classes/ABingoCampingPlugin/Models.html#M000056">included (ABingoCampingPlugin::Models)</a><br />
|
63
|
-
<a href="classes/ABingoCampingPlugin/Filters.html#M000055">included (ABingoCampingPlugin::Filters)</a><br />
|
64
|
-
<a href="classes/CampingABingoTest/Views.html#M000019">index (CampingABingoTest::Views)</a><br />
|
65
|
-
<a href="classes/Abingo.html#M000009">is_human? (Abingo)</a><br />
|
66
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000048">is_statistically_significant? (ABingoCampingPlugin::Helpers)</a><br />
|
67
|
-
<a href="classes/CampingABingoTest/Views.html#M000020">landing (CampingABingoTest::Views)</a><br />
|
68
|
-
<a href="classes/CampingABingoTest/Views.html#M000018">layout (CampingABingoTest::Views)</a><br />
|
69
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000042">log_debug (ABingoCampingPlugin::Helpers)</a><br />
|
70
|
-
<a href="classes/ABingoCampingPlugin.html#M000034">logger (ABingoCampingPlugin)</a><br />
|
71
|
-
<a href="classes/ABingoCampingPlugin.html#M000035">logger= (ABingoCampingPlugin)</a><br />
|
72
|
-
<a href="classes/Abingo.html#M000013">modulo_choice (Abingo)</a><br />
|
73
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000047">p_value (ABingoCampingPlugin::Helpers)</a><br />
|
74
|
-
<a href="classes/Abingo.html#M000010">parse_alternatives (Abingo)</a><br />
|
75
|
-
<a href="classes/ABingoCampingPlugin/Models/Experiment.html#M000064">participants (ABingoCampingPlugin::Models::Experiment)</a><br />
|
76
|
-
<a href="classes/Abingo.html#M000007">participating_tests (Abingo)</a><br />
|
77
|
-
<a href="classes/CampingABingoTest/Controllers/SignIn.html#M000031">post (CampingABingoTest::Controllers::SignIn)</a><br />
|
78
|
-
<a href="classes/CampingABingoTest/Controllers/SignUp.html#M000028">post (CampingABingoTest::Controllers::SignUp)</a><br />
|
79
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000045">pretty_conversion_rate (ABingoCampingPlugin::Helpers)</a><br />
|
80
|
-
<a href="classes/Abingo.html#M000011">retrieve_alternatives (Abingo)</a><br />
|
81
|
-
<a href="classes/ABingoCampingPlugin/Models/Alternative.html#M000060">score_conversion (ABingoCampingPlugin::Models::Alternative)</a><br />
|
82
|
-
<a href="classes/Abingo.html#M000014">score_conversion! (Abingo)</a><br />
|
83
|
-
<a href="classes/ABingoCampingPlugin/Models/Alternative.html#M000061">score_participation (ABingoCampingPlugin::Models::Alternative)</a><br />
|
84
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000052">set_abingo_identity (ABingoCampingPlugin::Helpers)</a><br />
|
85
|
-
<a href="classes/CampingABingoTest/Views.html#M000021">signin (CampingABingoTest::Views)</a><br />
|
86
|
-
<a href="classes/CampingABingoTest/Views.html#M000022">signup (CampingABingoTest::Views)</a><br />
|
87
|
-
<a href="classes/ABingoCampingPlugin/Models/Experiment.html#M000069">start_experiment! (ABingoCampingPlugin::Models::Experiment)</a><br />
|
88
|
-
<a href="classes/Abingo.html#M000005">test (Abingo)</a><br />
|
89
|
-
<a href="classes/ABingoCampingPlugin/Models.html#M000057">up (ABingoCampingPlugin::Models)</a><br />
|
90
|
-
<a href="classes/CampingABingoTest/Models/CreateUserSchema.html#M000032">up (CampingABingoTest::Models::CreateUserSchema)</a><br />
|
91
|
-
<a href="classes/CampingABingoTest/Views.html#M000023">welcome (CampingABingoTest::Views)</a><br />
|
92
|
-
<a href="classes/ABingoCampingPlugin/Helpers.html#M000046">zscore (ABingoCampingPlugin::Helpers)</a><br />
|
23
|
+
<a href="classes/CampingABingoTest.html#M000002">create (CampingABingoTest)</a><br />
|
24
|
+
<a href="classes/ActiveSupport/Cache/MemoryStore.html#M000001">data (ActiveSupport::Cache::MemoryStore)</a><br />
|
25
|
+
<a href="classes/CampingABingoTest/Models/CreateUserSchema.html#M000018">down (CampingABingoTest::Models::CreateUserSchema)</a><br />
|
26
|
+
<a href="classes/CampingABingoTest/Controllers/Welcome.html#M000010">get (CampingABingoTest::Controllers::Welcome)</a><br />
|
27
|
+
<a href="classes/CampingABingoTest/Controllers/SignIn.html#M000015">get (CampingABingoTest::Controllers::SignIn)</a><br />
|
28
|
+
<a href="classes/CampingABingoTest/Controllers/SignOut.html#M000014">get (CampingABingoTest::Controllers::SignOut)</a><br />
|
29
|
+
<a href="classes/CampingABingoTest/Controllers/SignUp.html#M000012">get (CampingABingoTest::Controllers::SignUp)</a><br />
|
30
|
+
<a href="classes/CampingABingoTest/Controllers/Index.html#M000009">get (CampingABingoTest::Controllers::Index)</a><br />
|
31
|
+
<a href="classes/CampingABingoTest/Controllers/Landing.html#M000011">get (CampingABingoTest::Controllers::Landing)</a><br />
|
32
|
+
<a href="classes/CampingABingoTest/Views.html#M000004">index (CampingABingoTest::Views)</a><br />
|
33
|
+
<a href="classes/CampingABingoTest/Views.html#M000005">landing (CampingABingoTest::Views)</a><br />
|
34
|
+
<a href="classes/CampingABingoTest/Views.html#M000003">layout (CampingABingoTest::Views)</a><br />
|
35
|
+
<a href="classes/CampingABingoTest/Controllers/SignUp.html#M000013">post (CampingABingoTest::Controllers::SignUp)</a><br />
|
36
|
+
<a href="classes/CampingABingoTest/Controllers/SignIn.html#M000016">post (CampingABingoTest::Controllers::SignIn)</a><br />
|
37
|
+
<a href="classes/CampingABingoTest/Views.html#M000006">signin (CampingABingoTest::Views)</a><br />
|
38
|
+
<a href="classes/CampingABingoTest/Views.html#M000007">signup (CampingABingoTest::Views)</a><br />
|
39
|
+
<a href="classes/CampingABingoTest/Models/CreateUserSchema.html#M000017">up (CampingABingoTest::Models::CreateUserSchema)</a><br />
|
40
|
+
<a href="classes/CampingABingoTest/Views.html#M000008">welcome (CampingABingoTest::Views)</a><br />
|
93
41
|
</div>
|
94
42
|
</div>
|
95
43
|
</body>
|
@@ -0,0 +1,456 @@
|
|
1
|
+
# NOTE: This sample is a basic skeletonfor the CampingABingoTest web app
|
2
|
+
# which does NOT yet contain any integration with ABingo.
|
3
|
+
#
|
4
|
+
# You can use this as a starting point to follow along the instructions to add
|
5
|
+
# ABingo support based on the blog post series: http://blog.monnet-usa.com/?p=322
|
6
|
+
#
|
7
|
+
gem 'camping' , '>= 2.0'
|
8
|
+
gem 'filtering_camping' , '>= 1.0'
|
9
|
+
|
10
|
+
%w(rubygems active_record erb fileutils json markaby md5 redcloth
|
11
|
+
camping camping/session filtering_camping
|
12
|
+
).each { |lib| require lib }
|
13
|
+
|
14
|
+
Camping.goes :CampingABingoTest
|
15
|
+
|
16
|
+
module CampingABingoTest
|
17
|
+
include Camping::Session
|
18
|
+
include CampingFilters
|
19
|
+
|
20
|
+
app_logger = Logger.new(File.dirname(__FILE__) + '/camping-abingo-test.log')
|
21
|
+
app_logger.level = Logger::DEBUG
|
22
|
+
Camping::Models::Base.logger = app_logger
|
23
|
+
|
24
|
+
def CampingABingoTest.create
|
25
|
+
dbconfig = YAML.load(File.read('config/database.yml'))
|
26
|
+
Camping::Models::Base.establish_connection dbconfig['development']
|
27
|
+
|
28
|
+
CampingABingoTest::Models.create_schema :assume => (CampingABingoTest::Models::User.table_exists? ? 1.1 : 0.0)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
module CampingABingoTest::Models
|
33
|
+
class User < Base;
|
34
|
+
end
|
35
|
+
|
36
|
+
class CreateUserSchema < V 1.0
|
37
|
+
def self.up
|
38
|
+
create_table :CampingABingoTest_users, :force => true do |t|
|
39
|
+
t.integer :id, :null => false
|
40
|
+
t.string :username
|
41
|
+
t.string :password
|
42
|
+
end
|
43
|
+
|
44
|
+
User.create :username => 'admin', :password => 'camping'
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.down
|
48
|
+
drop_table :CampingABingoTest_users
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
module CampingABingoTest::Helpers
|
55
|
+
end
|
56
|
+
|
57
|
+
module CampingABingoTest::Controllers
|
58
|
+
class Index
|
59
|
+
def get
|
60
|
+
render :index
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class Landing < R '/landing'
|
65
|
+
def get
|
66
|
+
render :landing
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class SignIn < R '/signin'
|
71
|
+
def get
|
72
|
+
render :signin
|
73
|
+
end
|
74
|
+
|
75
|
+
def post
|
76
|
+
@user = User.find_by_username_and_password(input.username, input.password)
|
77
|
+
|
78
|
+
if @user
|
79
|
+
@state.user_id = @user.id
|
80
|
+
|
81
|
+
if @state.return_to.nil?
|
82
|
+
redirect R(Welcome)
|
83
|
+
else
|
84
|
+
return_to = @state.return_to
|
85
|
+
@state.return_to = nil
|
86
|
+
redirect(return_to)
|
87
|
+
end
|
88
|
+
else
|
89
|
+
@info = 'Wrong username or password.'
|
90
|
+
end
|
91
|
+
|
92
|
+
render :signin
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
class SignOut < R '/signout'
|
97
|
+
def get
|
98
|
+
@state.user_id = nil
|
99
|
+
|
100
|
+
render :index
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
class SignUp < R '/signup'
|
105
|
+
def get
|
106
|
+
render :signup
|
107
|
+
end
|
108
|
+
|
109
|
+
def post
|
110
|
+
@user = User.find_by_username(input.username)
|
111
|
+
if @user
|
112
|
+
@info = 'A user account already exist for this username.'
|
113
|
+
else
|
114
|
+
@user = User.new :username => input.username,
|
115
|
+
:password => input.password
|
116
|
+
@user.save
|
117
|
+
if @user
|
118
|
+
@state.user_id = @user.id
|
119
|
+
redirect R(Welcome)
|
120
|
+
else
|
121
|
+
@info = @user.errors.full_messages unless @user.errors.empty?
|
122
|
+
end
|
123
|
+
end
|
124
|
+
render :signup
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
class Welcome < R '/welcome'
|
129
|
+
def get
|
130
|
+
render :welcome
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
end #Controllers
|
135
|
+
|
136
|
+
module CampingABingoTest::Views
|
137
|
+
def layout
|
138
|
+
html do
|
139
|
+
|
140
|
+
head do
|
141
|
+
title "Ruby Camping ABingo Plugin Demo"
|
142
|
+
|
143
|
+
style :type => 'text/css' do
|
144
|
+
<<-STYLE
|
145
|
+
|
146
|
+
/* --- General Test App Styles --- */
|
147
|
+
|
148
|
+
body {
|
149
|
+
padding:0 0 0 0;
|
150
|
+
margin:5px;
|
151
|
+
font-family:'Lucida Grande','Lucida Sans Unicode',sans-serif;
|
152
|
+
font-size: 0.8em;
|
153
|
+
color:#303030;
|
154
|
+
background-color: #fbf9b5;
|
155
|
+
}
|
156
|
+
|
157
|
+
a {
|
158
|
+
color:#303030;
|
159
|
+
text-decoration:none;
|
160
|
+
border-bottom:1px dotted #505050;
|
161
|
+
}
|
162
|
+
|
163
|
+
a:hover {
|
164
|
+
color:#303030;
|
165
|
+
background: yellow;
|
166
|
+
text-decoration:none;
|
167
|
+
border-bottom:4px solid orange;
|
168
|
+
}
|
169
|
+
|
170
|
+
h1 {
|
171
|
+
font-size: 14px;
|
172
|
+
color: #cc3300;
|
173
|
+
}
|
174
|
+
|
175
|
+
table {
|
176
|
+
font-size:0.9em;
|
177
|
+
width: 1050px;
|
178
|
+
}
|
179
|
+
|
180
|
+
tr
|
181
|
+
{
|
182
|
+
background:lightgoldenRodYellow;
|
183
|
+
vertical-align:top;
|
184
|
+
}
|
185
|
+
|
186
|
+
th
|
187
|
+
{
|
188
|
+
font-size: 0.9em;
|
189
|
+
font-weight:bold;
|
190
|
+
background:lightBlue none repeat scroll 0 0;
|
191
|
+
|
192
|
+
text-align:left;
|
193
|
+
}
|
194
|
+
|
195
|
+
#header
|
196
|
+
{
|
197
|
+
width: 100%;
|
198
|
+
height: 30px;
|
199
|
+
border-bottom: 4px solid #ccc;
|
200
|
+
}
|
201
|
+
|
202
|
+
#header_title
|
203
|
+
{
|
204
|
+
float: left;
|
205
|
+
}
|
206
|
+
|
207
|
+
#top_nav
|
208
|
+
{
|
209
|
+
float: right;
|
210
|
+
}
|
211
|
+
|
212
|
+
#footer
|
213
|
+
{
|
214
|
+
width: 100%;
|
215
|
+
border-top: 4px solid #ccc;
|
216
|
+
}
|
217
|
+
|
218
|
+
|
219
|
+
#footer_notices
|
220
|
+
{
|
221
|
+
width: 100%;
|
222
|
+
border-top: 4px solid #ccc;
|
223
|
+
}
|
224
|
+
|
225
|
+
#home
|
226
|
+
{
|
227
|
+
background-color: #C9E3F5;
|
228
|
+
padding: 10px;
|
229
|
+
height: 300px;
|
230
|
+
}
|
231
|
+
|
232
|
+
#debug_panel
|
233
|
+
{
|
234
|
+
background-color: wheat;
|
235
|
+
padding: 10px;
|
236
|
+
}
|
237
|
+
|
238
|
+
.xyz
|
239
|
+
{
|
240
|
+
background-color: #D1F2A5;
|
241
|
+
padding: 10px;
|
242
|
+
height: 300px;
|
243
|
+
}
|
244
|
+
|
245
|
+
.xyz h1
|
246
|
+
{
|
247
|
+
color: #9D9F89;
|
248
|
+
}
|
249
|
+
|
250
|
+
#special_promo
|
251
|
+
{
|
252
|
+
margin: 20px;
|
253
|
+
}
|
254
|
+
|
255
|
+
#landing a:hover
|
256
|
+
{
|
257
|
+
background-color: #B2DE93;
|
258
|
+
border-bottom-color:green;
|
259
|
+
}
|
260
|
+
|
261
|
+
#marketing
|
262
|
+
{
|
263
|
+
width: 480px;
|
264
|
+
height: 100px;
|
265
|
+
margin: 20px;
|
266
|
+
}
|
267
|
+
|
268
|
+
#benefits
|
269
|
+
{
|
270
|
+
float: left;
|
271
|
+
width: 300px;
|
272
|
+
height: 100px;
|
273
|
+
font-size: 1.3em;
|
274
|
+
font-weight: bold;
|
275
|
+
color: green;
|
276
|
+
background-color: #B2DE93;
|
277
|
+
}
|
278
|
+
|
279
|
+
#actnow
|
280
|
+
{
|
281
|
+
float: right;
|
282
|
+
width: 180px;
|
283
|
+
height: 100px;
|
284
|
+
text-align: center;
|
285
|
+
background-color: #8BC59B;
|
286
|
+
}
|
287
|
+
|
288
|
+
#signup_btn
|
289
|
+
{
|
290
|
+
background-color:#91F1A0;
|
291
|
+
border:4px solid green;
|
292
|
+
font-size:1.5em;
|
293
|
+
font-weight:bold;
|
294
|
+
height:72px;
|
295
|
+
margin: 10px 20px 10px 22px;
|
296
|
+
width:130px;
|
297
|
+
}
|
298
|
+
|
299
|
+
#actnow a:hover #signup_btn
|
300
|
+
{
|
301
|
+
background-color: #69F17F;
|
302
|
+
color: #007300;
|
303
|
+
border: 4px solid #00AA00;
|
304
|
+
}
|
305
|
+
|
306
|
+
/* --- ABingo Dashboard Styles ---*/
|
307
|
+
|
308
|
+
#abingo_dashboard
|
309
|
+
{
|
310
|
+
background-color: white;
|
311
|
+
padding: 10px;
|
312
|
+
}
|
313
|
+
|
314
|
+
abingo_experiment_table
|
315
|
+
{
|
316
|
+
width: 100%;
|
317
|
+
}
|
318
|
+
|
319
|
+
.abingo_experiment_row
|
320
|
+
{
|
321
|
+
}
|
322
|
+
|
323
|
+
.abingo_alternative_row
|
324
|
+
{
|
325
|
+
color: red;
|
326
|
+
font-weight: bold;
|
327
|
+
}
|
328
|
+
|
329
|
+
.abingo_debug
|
330
|
+
{
|
331
|
+
display: block;
|
332
|
+
width: 100%;
|
333
|
+
}
|
334
|
+
|
335
|
+
.abingo_explain
|
336
|
+
{
|
337
|
+
color: #CCC;
|
338
|
+
font-style:italics;
|
339
|
+
}
|
340
|
+
|
341
|
+
|
342
|
+
STYLE
|
343
|
+
end
|
344
|
+
end #head
|
345
|
+
|
346
|
+
body do
|
347
|
+
div.header! do
|
348
|
+
div.header_title! "Ruby Camping ABingo Plugin Demo"
|
349
|
+
div.top_nav! do
|
350
|
+
a "Home", :href=>"/"
|
351
|
+
span " | "
|
352
|
+
if @state.nil? || @state.user_id.nil?
|
353
|
+
a "Sign-In", :href=>'/signin'
|
354
|
+
span " | "
|
355
|
+
a "Sign-Up", :href=>'/signup'
|
356
|
+
else
|
357
|
+
a "XYZ", :href=>"/welcome"
|
358
|
+
span " | "
|
359
|
+
a "Sign-Out", :href=>'/signout'
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
self << yield
|
365
|
+
|
366
|
+
div.footer! do
|
367
|
+
div.debug_panel! do
|
368
|
+
h4 "Debugging Information:"
|
369
|
+
h5 "State:"
|
370
|
+
div "#{@state.inspect}"
|
371
|
+
end
|
372
|
+
|
373
|
+
div.footer_notices! { "Copyright © 2010 - #{ a('Patrick McKenzie', :href => 'http://www.bingocardcreator.com/abingo') } and #{ a('Philippe Monnet', :href => 'http://blog.monnet-usa.com/') } " }
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
|
381
|
+
def index
|
382
|
+
div.home! do
|
383
|
+
h1 'My CampingABingoTest App'
|
384
|
+
|
385
|
+
a "XYZ SAAS Application Landing page variations", :href=>"/landing"; br;
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
def landing
|
390
|
+
div.xyz do
|
391
|
+
h1 'XYZ SAAS Application'
|
392
|
+
|
393
|
+
div.marketing! do
|
394
|
+
div.benefits! do
|
395
|
+
ul do
|
396
|
+
li "Save XYZ time in half"
|
397
|
+
li "Reduce XYZ cost by 25%"
|
398
|
+
li "Improve quality"
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
div.actnow! do
|
403
|
+
signup_text = "Sign-Up Now!"
|
404
|
+
|
405
|
+
a :href=>"/signup" do
|
406
|
+
div.signup_btn! signup_text
|
407
|
+
end
|
408
|
+
end
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
def signin
|
414
|
+
div.xyz do
|
415
|
+
h1 'XYZ SAAS Application Sign-In'
|
416
|
+
div @info if @info
|
417
|
+
|
418
|
+
form :action => R(SignIn), :method => 'post' do
|
419
|
+
label 'Username', :for => 'username'; br
|
420
|
+
input :name => 'username', :type => 'text'; br
|
421
|
+
|
422
|
+
label 'Password', :for => 'password'; br
|
423
|
+
input :name => 'password', :type => 'text'; br
|
424
|
+
|
425
|
+
input :type => 'submit', :name => 'signin', :value => 'Sign-In'
|
426
|
+
end
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
def signup
|
431
|
+
div.xyz do
|
432
|
+
h1 'XYZ SAAS Application Sign-Up'
|
433
|
+
div @info if @info
|
434
|
+
|
435
|
+
form :action => R(SignUp), :method => 'post' do
|
436
|
+
label 'Username', :for => 'username'; br
|
437
|
+
input :name => 'username', :type => 'text'; br
|
438
|
+
|
439
|
+
label 'Password', :for => 'password'; br
|
440
|
+
input :name => 'password', :type => 'password'; br;br
|
441
|
+
|
442
|
+
input :type => 'submit', :name => 'signup', :value => 'Sign-Up'
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|
446
|
+
|
447
|
+
def welcome
|
448
|
+
div.xyz do
|
449
|
+
h1 'Welcome'
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
453
|
+
end
|
454
|
+
|
455
|
+
CampingABingoTest.create
|
456
|
+
|