wee 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/ChangeLog +132 -0
  2. data/INSTALL +13 -3
  3. data/README +3 -3
  4. data/Rakefile +5 -1
  5. data/bin/wee +100 -0
  6. data/doc/rdoc/classes/Array.html +12 -12
  7. data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
  8. data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
  9. data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
  10. data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
  11. data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
  12. data/doc/rdoc/classes/Enumerable.html +6 -6
  13. data/doc/rdoc/classes/Main.html +265 -0
  14. data/doc/rdoc/classes/Object.html +12 -12
  15. data/doc/rdoc/classes/OgApplication.html +2 -2
  16. data/doc/rdoc/classes/OgScaffolder.html +444 -64
  17. data/doc/rdoc/classes/OgScaffolder/Editor.html +490 -0
  18. data/doc/rdoc/classes/OgSession.html +4 -4
  19. data/doc/rdoc/classes/Recipe.html +113 -0
  20. data/doc/rdoc/classes/String.html +12 -12
  21. data/doc/rdoc/classes/Struct.html +12 -12
  22. data/doc/rdoc/classes/Wee.html +10 -1
  23. data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
  24. data/doc/rdoc/classes/Wee/Application.html +48 -47
  25. data/doc/rdoc/classes/Wee/Brush.html +19 -23
  26. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +17 -14
  27. data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +20 -14
  28. data/doc/rdoc/classes/Wee/Brush/FormTag.html +25 -21
  29. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
  30. data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +7 -7
  31. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +234 -100
  32. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
  33. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +28 -22
  34. data/doc/rdoc/classes/Wee/Brush/ImageTag.html +23 -24
  35. data/doc/rdoc/classes/Wee/Brush/InputTag.html +14 -14
  36. data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +7 -7
  37. data/doc/rdoc/classes/Wee/Brush/Page.html +14 -14
  38. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +33 -57
  39. data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +154 -0
  40. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -7
  41. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +20 -14
  42. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +14 -14
  43. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
  44. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +42 -42
  45. data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
  46. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +27 -21
  47. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +20 -14
  48. data/doc/rdoc/classes/Wee/CallbackRegistry.html +64 -36
  49. data/doc/rdoc/classes/Wee/CallbackStream.html +21 -21
  50. data/doc/rdoc/classes/Wee/Canvas.html +24 -24
  51. data/doc/rdoc/classes/Wee/Component.html +179 -151
  52. data/doc/rdoc/classes/Wee/Component/OnAnswer.html +12 -12
  53. data/doc/rdoc/classes/Wee/Decoration.html +42 -42
  54. data/doc/rdoc/classes/Wee/Delegate.html +27 -27
  55. data/doc/rdoc/classes/Wee/ErrorResponse.html +14 -14
  56. data/doc/rdoc/classes/Wee/FormDecoration.html +6 -6
  57. data/doc/rdoc/classes/Wee/GenericResponse.html +7 -7
  58. data/doc/rdoc/classes/Wee/HtmlCanvas.html +326 -219
  59. data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
  60. data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +19 -19
  61. data/doc/rdoc/classes/Wee/Md5IdGenerator.html +181 -0
  62. data/doc/rdoc/classes/Wee/MessageBox.html +12 -12
  63. data/doc/rdoc/classes/Wee/PageDecoration.html +18 -18
  64. data/doc/rdoc/classes/Wee/PagelessApplication.html +152 -0
  65. data/doc/rdoc/classes/Wee/PagelessRequest.html +177 -0
  66. data/doc/rdoc/classes/Wee/PagelessSession.html +320 -0
  67. data/doc/rdoc/classes/Wee/Presenter.html +145 -89
  68. data/doc/rdoc/classes/Wee/RedirectResponse.html +7 -7
  69. data/doc/rdoc/classes/Wee/RefreshResponse.html +7 -7
  70. data/doc/rdoc/classes/Wee/Request.html +116 -50
  71. data/doc/rdoc/classes/Wee/RequestHandler.html +31 -31
  72. data/doc/rdoc/classes/Wee/Response.html +76 -28
  73. data/doc/rdoc/classes/Wee/Session.html +129 -506
  74. data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +22 -40
  75. data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
  76. data/doc/rdoc/classes/Wee/Utils.html +70 -17
  77. data/doc/rdoc/classes/Wee/Utils/LRUCache.html +6 -6
  78. data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
  79. data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +82 -49
  80. data/doc/rdoc/classes/Wee/WrapperDecoration.html +6 -6
  81. data/doc/rdoc/created.rid +1 -1
  82. data/doc/rdoc/files/INSTALL.html +17 -5
  83. data/doc/rdoc/files/README.html +9 -11
  84. data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
  85. data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
  86. data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
  87. data/doc/rdoc/files/lib/wee/continuation/session_rb.html +1 -3
  88. data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
  89. data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
  90. data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
  91. data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +101 -0
  92. data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +101 -0
  93. data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +108 -0
  94. data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +101 -0
  95. data/doc/rdoc/files/lib/wee/databases/og_rb.html +4 -1
  96. data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +115 -0
  97. data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +107 -0
  98. data/doc/rdoc/files/lib/wee/pageless/application_rb.html +101 -0
  99. data/doc/rdoc/files/lib/wee/pageless/request_rb.html +101 -0
  100. data/doc/rdoc/files/lib/wee/pageless/session_rb.html +108 -0
  101. data/doc/rdoc/files/lib/wee/pageless_rb.html +110 -0
  102. data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
  103. data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +8 -1
  104. data/doc/rdoc/files/lib/wee/request_rb.html +1 -1
  105. data/doc/rdoc/files/lib/wee/response_rb.html +1 -1
  106. data/doc/rdoc/files/lib/wee/session_rb.html +1 -1
  107. data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +101 -0
  108. data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +114 -0
  109. data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +101 -0
  110. data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +115 -0
  111. data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +101 -0
  112. data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +111 -0
  113. data/doc/rdoc/files/lib/wee/template_rb.html +101 -0
  114. data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
  115. data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -1
  116. data/doc/rdoc/files/lib/wee_rb.html +4 -2
  117. data/doc/rdoc/fr_class_index.html +8 -4
  118. data/doc/rdoc/fr_file_index.html +17 -1
  119. data/doc/rdoc/fr_method_index.html +312 -267
  120. data/examples/live-update.rb +1 -1
  121. data/install.rb +14 -0
  122. data/lib/wee.rb +6 -2
  123. data/lib/wee/adaptors/webrick.rb +17 -5
  124. data/lib/wee/application.rb +2 -1
  125. data/lib/wee/continuation/session.rb +1 -146
  126. data/lib/wee/core/callback.rb +11 -5
  127. data/lib/wee/core/component.rb +14 -10
  128. data/lib/wee/databases/og.rb +3 -113
  129. data/lib/wee/databases/og/application.rb +3 -0
  130. data/lib/wee/databases/og/old_scaffolder.rb +98 -0
  131. data/lib/wee/databases/og/scaffolder.rb +174 -0
  132. data/lib/wee/databases/og/session.rb +9 -0
  133. data/lib/wee/idgen/md5.rb +21 -0
  134. data/lib/wee/{idgen.rb → idgen/simple.rb} +2 -4
  135. data/lib/wee/pageless.rb +3 -0
  136. data/lib/wee/pageless/application.rb +9 -0
  137. data/lib/wee/pageless/request.rb +15 -0
  138. data/lib/wee/pageless/session.rb +89 -0
  139. data/lib/wee/renderer/html/brushes.rb +100 -115
  140. data/lib/wee/renderer/html/canvas.rb +32 -2
  141. data/lib/wee/request.rb +36 -24
  142. data/lib/wee/response.rb +8 -1
  143. data/lib/wee/session.rb +13 -7
  144. data/lib/wee/skeleton/og/README +38 -0
  145. data/lib/wee/skeleton/og/components/main.rb +16 -0
  146. data/lib/wee/skeleton/og/conf/db.rb +8 -0
  147. data/lib/wee/skeleton/og/models/recipe.rb +5 -0
  148. data/lib/wee/skeleton/og/run.rb +23 -0
  149. data/lib/wee/skeleton/simple/README +32 -0
  150. data/lib/wee/skeleton/simple/components/main.rb +25 -0
  151. data/lib/wee/skeleton/simple/run.rb +12 -0
  152. data/lib/wee/template.rb +28 -0
  153. data/lib/wee/utils/autoreload.rb +29 -0
  154. data/lib/wee/utils/helper.rb +9 -5
  155. data/test/test_request.rb +4 -3
  156. data/wee.gemspec +3 -1
  157. metadata +91 -22
@@ -88,9 +88,9 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000251">global?</a>&nbsp;&nbsp;
92
- <a href="#M000250">new</a>&nbsp;&nbsp;
93
- <a href="#M000252">render_wrapper</a>&nbsp;&nbsp;
91
+ <a href="#M000296">global?</a>&nbsp;&nbsp;
92
+ <a href="#M000295">new</a>&nbsp;&nbsp;
93
+ <a href="#M000297">render_wrapper</a>&nbsp;&nbsp;
94
94
  </div>
95
95
  </div>
96
96
 
@@ -112,19 +112,19 @@
112
112
  <div id="methods">
113
113
  <h3 class="section-bar">Public Class methods</h3>
114
114
 
115
- <div id="method-M000250" class="method-detail">
116
- <a name="M000250"></a>
115
+ <div id="method-M000295" class="method-detail">
116
+ <a name="M000295"></a>
117
117
 
118
118
  <div class="method-heading">
119
- <a href="#M000250" class="method-signature">
119
+ <a href="#M000295" class="method-signature">
120
120
  <span class="method-name">new</span><span class="method-args">(title='')</span>
121
121
  </a>
122
122
  </div>
123
123
 
124
124
  <div class="method-description">
125
125
  <p><a class="source-toggle" href="#"
126
- onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
127
- <div class="method-source-code" id="M000250-source">
126
+ onclick="toggleCode('M000295-source');return false;">[Source]</a></p>
127
+ <div class="method-source-code" id="M000295-source">
128
128
  <pre>
129
129
  <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 2</span>
130
130
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">title</span>=<span class="ruby-value str">''</span>)
@@ -138,19 +138,19 @@
138
138
 
139
139
  <h3 class="section-bar">Public Instance methods</h3>
140
140
 
141
- <div id="method-M000251" class="method-detail">
142
- <a name="M000251"></a>
141
+ <div id="method-M000296" class="method-detail">
142
+ <a name="M000296"></a>
143
143
 
144
144
  <div class="method-heading">
145
- <a href="#M000251" class="method-signature">
145
+ <a href="#M000296" class="method-signature">
146
146
  <span class="method-name">global?</span><span class="method-args">()</span>
147
147
  </a>
148
148
  </div>
149
149
 
150
150
  <div class="method-description">
151
151
  <p><a class="source-toggle" href="#"
152
- onclick="toggleCode('M000251-source');return false;">[Source]</a></p>
153
- <div class="method-source-code" id="M000251-source">
152
+ onclick="toggleCode('M000296-source');return false;">[Source]</a></p>
153
+ <div class="method-source-code" id="M000296-source">
154
154
  <pre>
155
155
  <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 7</span>
156
156
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global?</span>() <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span>
@@ -161,19 +161,19 @@
161
161
 
162
162
  <h3 class="section-bar">Private Instance methods</h3>
163
163
 
164
- <div id="method-M000252" class="method-detail">
165
- <a name="M000252"></a>
164
+ <div id="method-M000297" class="method-detail">
165
+ <a name="M000297"></a>
166
166
 
167
167
  <div class="method-heading">
168
- <a href="#M000252" class="method-signature">
168
+ <a href="#M000297" class="method-signature">
169
169
  <span class="method-name">render_wrapper</span><span class="method-args">() {|| ...}</span>
170
170
  </a>
171
171
  </div>
172
172
 
173
173
  <div class="method-description">
174
174
  <p><a class="source-toggle" href="#"
175
- onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
176
- <div class="method-source-code" id="M000252-source">
175
+ onclick="toggleCode('M000297-source');return false;">[Source]</a></p>
176
+ <div class="method-source-code" id="M000297-source">
177
177
  <pre>
178
178
  <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 11</span>
179
179
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_wrapper</span>
@@ -0,0 +1,152 @@
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>Class: Wee::PagelessApplication</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="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Wee::PagelessApplication</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/pageless/application_rb.html">
59
+ lib/wee/pageless/application.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Application.html">
69
+ Wee::Application
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000269">request_handler_expired</a>&nbsp;&nbsp;
92
+ </div>
93
+ </div>
94
+
95
+ </div>
96
+
97
+
98
+ <!-- if includes -->
99
+
100
+ <div id="section">
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <!-- if method_list -->
110
+ <div id="methods">
111
+ <h3 class="section-bar">Public Instance methods</h3>
112
+
113
+ <div id="method-M000269" class="method-detail">
114
+ <a name="M000269"></a>
115
+
116
+ <div class="method-heading">
117
+ <a href="#M000269" class="method-signature">
118
+ <span class="method-name">request_handler_expired</span><span class="method-args">(context)</span>
119
+ </a>
120
+ </div>
121
+
122
+ <div class="method-description">
123
+ <p><a class="source-toggle" href="#"
124
+ onclick="toggleCode('M000269-source');return false;">[Source]</a></p>
125
+ <div class="method-source-code" id="M000269-source">
126
+ <pre>
127
+ <span class="ruby-comment cmt"># File lib/wee/pageless/application.rb, line 2</span>
128
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_handler_expired</span>(<span class="ruby-identifier">context</span>)
129
+ <span class="ruby-identifier">context</span>.<span class="ruby-identifier">response</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RedirectResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">application_path</span>)
130
+ <span class="ruby-comment cmt"># TODO: depends on WEBrick</span>
131
+ <span class="ruby-identifier">cookie</span> = <span class="ruby-constant">WEBrick</span><span class="ruby-operator">::</span><span class="ruby-constant">Cookie</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'SID'</span>, <span class="ruby-value str">''</span>)
132
+ <span class="ruby-identifier">cookie</span>.<span class="ruby-identifier">max_age</span> = <span class="ruby-value">0</span>
133
+ <span class="ruby-identifier">context</span>.<span class="ruby-identifier">response</span>.<span class="ruby-identifier">cookies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cookie</span>
134
+ <span class="ruby-keyword kw">end</span>
135
+ </pre>
136
+ </div>
137
+ </div>
138
+ </div>
139
+
140
+
141
+ </div>
142
+
143
+
144
+ </div>
145
+
146
+
147
+ <div id="validator-badges">
148
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
149
+ </div>
150
+
151
+ </body>
152
+ </html>
@@ -0,0 +1,177 @@
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>Class: Wee::PagelessRequest</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="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Wee::PagelessRequest</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/pageless/request_rb.html">
59
+ lib/wee/pageless/request.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Request.html">
69
+ Wee::Request
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="method-list">
88
+ <h3 class="section-bar">Methods</h3>
89
+
90
+ <div class="name-list">
91
+ <a href="#M000244">build_url</a>&nbsp;&nbsp;
92
+ <a href="#M000245">parse_path</a>&nbsp;&nbsp;
93
+ </div>
94
+ </div>
95
+
96
+ </div>
97
+
98
+
99
+ <!-- if includes -->
100
+
101
+ <div id="section">
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <!-- if method_list -->
111
+ <div id="methods">
112
+ <h3 class="section-bar">Public Instance methods</h3>
113
+
114
+ <div id="method-M000244" class="method-detail">
115
+ <a name="M000244"></a>
116
+
117
+ <div class="method-heading">
118
+ <a href="#M000244" class="method-signature">
119
+ <span class="method-name">build_url</span><span class="method-args">(request_handler_id=nil, page_id=nil, callback_id=nil)</span>
120
+ </a>
121
+ </div>
122
+
123
+ <div class="method-description">
124
+ <p><a class="source-toggle" href="#"
125
+ onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
126
+ <div class="method-source-code" id="M000244-source">
127
+ <pre>
128
+ <span class="ruby-comment cmt"># File lib/wee/pageless/request.rb, line 3</span>
129
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_url</span>(<span class="ruby-identifier">request_handler_id</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">page_id</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">callback_id</span>=<span class="ruby-keyword kw">nil</span>)
130
+ <span class="ruby-identifier">url</span> = <span class="ruby-value str">&quot;&quot;</span>
131
+ <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@app_path</span>
132
+ <span class="ruby-identifier">url</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">'?'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">callback_id</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback_id</span>
133
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">url</span>
134
+ <span class="ruby-keyword kw">end</span>
135
+ </pre>
136
+ </div>
137
+ </div>
138
+ </div>
139
+
140
+ <div id="method-M000245" class="method-detail">
141
+ <a name="M000245"></a>
142
+
143
+ <div class="method-heading">
144
+ <a href="#M000245" class="method-signature">
145
+ <span class="method-name">parse_path</span><span class="method-args">()</span>
146
+ </a>
147
+ </div>
148
+
149
+ <div class="method-description">
150
+ <p><a class="source-toggle" href="#"
151
+ onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
152
+ <div class="method-source-code" id="M000245-source">
153
+ <pre>
154
+ <span class="ruby-comment cmt"># File lib/wee/pageless/request.rb, line 10</span>
155
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_path</span>
156
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sid</span> = <span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'SID'</span>}
157
+ <span class="ruby-ivar">@request_handler_id</span> = <span class="ruby-identifier">sid</span>.<span class="ruby-identifier">value</span>
158
+ <span class="ruby-keyword kw">end</span>
159
+ <span class="ruby-keyword kw">end</span>
160
+ </pre>
161
+ </div>
162
+ </div>
163
+ </div>
164
+
165
+
166
+ </div>
167
+
168
+
169
+ </div>
170
+
171
+
172
+ <div id="validator-badges">
173
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
174
+ </div>
175
+
176
+ </body>
177
+ </html>
@@ -0,0 +1,320 @@
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>Class: Wee::PagelessSession</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="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Wee::PagelessSession</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/wee/pageless/session_rb.html">
59
+ lib/wee/pageless/session.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Session.html">
69
+ Wee::Session
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ A session class, which does not have a page-store and as such cannot
86
+ backtrack.
87
+ </p>
88
+
89
+ </div>
90
+
91
+
92
+ </div>
93
+
94
+ <div id="method-list">
95
+ <h3 class="section-bar">Methods</h3>
96
+
97
+ <div class="name-list">
98
+ <a href="#M000093">handle_new_page_view</a>&nbsp;&nbsp;
99
+ <a href="#M000091">new</a>&nbsp;&nbsp;
100
+ <a href="#M000092">process_request</a>&nbsp;&nbsp;
101
+ <a href="#M000094">set_response</a>&nbsp;&nbsp;
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+
107
+
108
+ <!-- if includes -->
109
+
110
+ <div id="section">
111
+
112
+
113
+
114
+ <div id="aliases-list">
115
+ <h3 class="section-bar">External Aliases</h3>
116
+
117
+ <div class="name-list">
118
+ <table summary="aliases">
119
+ <tr class="top-aligned-row context-row">
120
+ <td class="context-item-name">callbacks</td>
121
+ <td>-></td>
122
+ <td class="context-item-value">current_callbacks</td>
123
+ </tr>
124
+ </table>
125
+ </div>
126
+ </div>
127
+
128
+
129
+ <div id="attribute-list">
130
+ <h3 class="section-bar">Attributes</h3>
131
+
132
+ <div class="name-list">
133
+ <table>
134
+ <tr class="top-aligned-row context-row">
135
+ <td class="context-item-name">callbacks</td>
136
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
137
+ <td class="context-item-desc"></td>
138
+ </tr>
139
+ <tr class="top-aligned-row context-row">
140
+ <td class="context-item-name">root_component</td>
141
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
142
+ <td class="context-item-desc"></td>
143
+ </tr>
144
+ </table>
145
+ </div>
146
+ </div>
147
+
148
+
149
+
150
+ <!-- if method_list -->
151
+ <div id="methods">
152
+ <h3 class="section-bar">Public Class methods</h3>
153
+
154
+ <div id="method-M000091" class="method-detail">
155
+ <a name="M000091"></a>
156
+
157
+ <div class="method-heading">
158
+ <a href="#M000091" class="method-signature">
159
+ <span class="method-name">new</span><span class="method-args">(&amp;block)</span>
160
+ </a>
161
+ </div>
162
+
163
+ <div class="method-description">
164
+ <p><a class="source-toggle" href="#"
165
+ onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
166
+ <div class="method-source-code" id="M000091-source">
167
+ <pre>
168
+ <span class="ruby-comment cmt"># File lib/wee/pageless/session.rb, line 13</span>
169
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
170
+ <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:wee_session</span>] = <span class="ruby-keyword kw">self</span>
171
+
172
+ <span class="ruby-comment cmt"># to serialize the requests we need a mutex</span>
173
+ <span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
174
+
175
+ <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
176
+
177
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;No root component specified&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@root_component</span>.<span class="ruby-identifier">nil?</span>
178
+
179
+ <span class="ruby-keyword kw">super</span>()
180
+ <span class="ruby-keyword kw">ensure</span>
181
+ <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>[<span class="ruby-identifier">:wee_session</span>] = <span class="ruby-keyword kw">nil</span>
182
+ <span class="ruby-keyword kw">end</span>
183
+ </pre>
184
+ </div>
185
+ </div>
186
+ </div>
187
+
188
+ <h3 class="section-bar">Public Instance methods</h3>
189
+
190
+ <div id="method-M000092" class="method-detail">
191
+ <a name="M000092"></a>
192
+
193
+ <div class="method-heading">
194
+ <a href="#M000092" class="method-signature">
195
+ <span class="method-name">process_request</span><span class="method-args">()</span>
196
+ </a>
197
+ </div>
198
+
199
+ <div class="method-description">
200
+ <p><a class="source-toggle" href="#"
201
+ onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
202
+ <div class="method-source-code" id="M000092-source">
203
+ <pre>
204
+ <span class="ruby-comment cmt"># File lib/wee/pageless/session.rb, line 28</span>
205
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>
206
+ <span class="ruby-identifier">p</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">fields</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
207
+
208
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">fields</span>.<span class="ruby-identifier">empty?</span>
209
+
210
+ <span class="ruby-comment cmt"># No action/inputs were specified -&gt; render page</span>
211
+ <span class="ruby-comment cmt">#</span>
212
+ <span class="ruby-comment cmt"># 1. Reset the action/input fields (as they are regenerated in the</span>
213
+ <span class="ruby-comment cmt"># rendering process).</span>
214
+ <span class="ruby-comment cmt"># 2. Render the page (respond).</span>
215
+ <span class="ruby-comment cmt"># 3. Store the page back into the store</span>
216
+
217
+ <span class="ruby-identifier">new_callbacks</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">CallbackRegistry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">SimpleIdGenerator</span>.<span class="ruby-identifier">new</span>)
218
+ <span class="ruby-identifier">respond</span>(<span class="ruby-ivar">@context</span>, <span class="ruby-identifier">new_callbacks</span>) <span class="ruby-comment cmt"># render</span>
219
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">callbacks</span> = <span class="ruby-identifier">new_callbacks</span>
220
+
221
+ <span class="ruby-keyword kw">else</span>
222
+
223
+ <span class="ruby-comment cmt"># Actions/inputs were specified.</span>
224
+ <span class="ruby-comment cmt">#</span>
225
+ <span class="ruby-comment cmt"># We process the request and invoke actions/inputs. Then we generate a</span>
226
+ <span class="ruby-comment cmt"># new page view. </span>
227
+
228
+ <span class="ruby-identifier">callback_stream</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">CallbackStream</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">callbacks</span>, <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">fields</span>)
229
+
230
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">callback_stream</span>.<span class="ruby-identifier">all_of_type</span>(<span class="ruby-identifier">:action</span>).<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
231
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Not allowed to specify more than one action callback&quot;</span>
232
+ <span class="ruby-keyword kw">end</span>
233
+
234
+ <span class="ruby-identifier">live_update_response</span> = <span class="ruby-identifier">catch</span>(<span class="ruby-identifier">:wee_live_update</span>) {
235
+ <span class="ruby-identifier">catch</span>(<span class="ruby-identifier">:wee_back_to_session</span>) {
236
+ <span class="ruby-ivar">@root_component</span>.<span class="ruby-identifier">process_callbacks_chain</span>(<span class="ruby-identifier">callback_stream</span>)
237
+ }
238
+ <span class="ruby-keyword kw">nil</span>
239
+ }
240
+
241
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">live_update_response</span>
242
+ <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">response</span> = <span class="ruby-identifier">live_update_response</span>
243
+ <span class="ruby-keyword kw">else</span>
244
+ <span class="ruby-identifier">handle_new_page_view</span>(<span class="ruby-ivar">@context</span>)
245
+ <span class="ruby-keyword kw">end</span>
246
+
247
+ <span class="ruby-keyword kw">end</span>
248
+
249
+ <span class="ruby-keyword kw">end</span>
250
+ </pre>
251
+ </div>
252
+ </div>
253
+ </div>
254
+
255
+ <h3 class="section-bar">Private Instance methods</h3>
256
+
257
+ <div id="method-M000093" class="method-detail">
258
+ <a name="M000093"></a>
259
+
260
+ <div class="method-heading">
261
+ <a href="#M000093" class="method-signature">
262
+ <span class="method-name">handle_new_page_view</span><span class="method-args">(context)</span>
263
+ </a>
264
+ </div>
265
+
266
+ <div class="method-description">
267
+ <p><a class="source-toggle" href="#"
268
+ onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
269
+ <div class="method-source-code" id="M000093-source">
270
+ <pre>
271
+ <span class="ruby-comment cmt"># File lib/wee/pageless/session.rb, line 76</span>
272
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_new_page_view</span>(<span class="ruby-identifier">context</span>)
273
+ <span class="ruby-identifier">redirect_url</span> = <span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">build_url</span>(<span class="ruby-identifier">context</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">request_handler_id</span>, <span class="ruby-keyword kw">nil</span>)
274
+ <span class="ruby-identifier">set_response</span>(<span class="ruby-identifier">context</span>, <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RedirectResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">redirect_url</span>))
275
+ <span class="ruby-keyword kw">end</span>
276
+ </pre>
277
+ </div>
278
+ </div>
279
+ </div>
280
+
281
+ <div id="method-M000094" class="method-detail">
282
+ <a name="M000094"></a>
283
+
284
+ <div class="method-heading">
285
+ <a href="#M000094" class="method-signature">
286
+ <span class="method-name">set_response</span><span class="method-args">(context, response)</span>
287
+ </a>
288
+ </div>
289
+
290
+ <div class="method-description">
291
+ <p><a class="source-toggle" href="#"
292
+ onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
293
+ <div class="method-source-code" id="M000094-source">
294
+ <pre>
295
+ <span class="ruby-comment cmt"># File lib/wee/pageless/session.rb, line 81</span>
296
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_response</span>(<span class="ruby-identifier">context</span>, <span class="ruby-identifier">response</span>)
297
+ <span class="ruby-comment cmt"># TODO: depends on WEBrick!</span>
298
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">cookies</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">WEBrick</span><span class="ruby-operator">::</span><span class="ruby-constant">Cookie</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'SID'</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">id</span>)
299
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'Expire'</span>)
300
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>[<span class="ruby-value str">'Pragma'</span>] = <span class="ruby-value str">'No-Cache'</span>
301
+ <span class="ruby-keyword kw">super</span>
302
+ <span class="ruby-keyword kw">end</span>
303
+ </pre>
304
+ </div>
305
+ </div>
306
+ </div>
307
+
308
+
309
+ </div>
310
+
311
+
312
+ </div>
313
+
314
+
315
+ <div id="validator-badges">
316
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
317
+ </div>
318
+
319
+ </body>
320
+ </html>