serverside 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/CHANGELOG +16 -0
  2. data/Rakefile +16 -1
  3. data/lib/serverside/caching.rb +56 -0
  4. data/lib/serverside/request.rb +8 -4
  5. data/lib/serverside/static.rb +29 -51
  6. data/test/functional/static_server.rb +7 -0
  7. data/test/spec/caching_spec.rb +101 -0
  8. data/test/spec/connection_spec.rb +0 -2
  9. data/test/unit/request_test.rb +31 -1
  10. data/test/unit/static_test.rb +21 -25
  11. metadata +30 -75
  12. data/doc/rdoc/classes/Daemon/Base.html +0 -148
  13. data/doc/rdoc/classes/Daemon/Cluster/PidFile.html +0 -230
  14. data/doc/rdoc/classes/Daemon/Cluster.html +0 -308
  15. data/doc/rdoc/classes/Daemon/PidFile.html +0 -178
  16. data/doc/rdoc/classes/Daemon.html +0 -253
  17. data/doc/rdoc/classes/Object.html +0 -151
  18. data/doc/rdoc/classes/Proc.html +0 -151
  19. data/doc/rdoc/classes/ServerSide/Application.html +0 -172
  20. data/doc/rdoc/classes/ServerSide/HTTP/Connection.html +0 -202
  21. data/doc/rdoc/classes/ServerSide/HTTP/Request.html +0 -768
  22. data/doc/rdoc/classes/ServerSide/HTTP/Server.html +0 -164
  23. data/doc/rdoc/classes/ServerSide/HTTP.html +0 -121
  24. data/doc/rdoc/classes/ServerSide/Router.html +0 -496
  25. data/doc/rdoc/classes/ServerSide/StaticFiles/Const.html +0 -204
  26. data/doc/rdoc/classes/ServerSide/StaticFiles.html +0 -282
  27. data/doc/rdoc/classes/ServerSide/Template.html +0 -200
  28. data/doc/rdoc/classes/ServerSide.html +0 -174
  29. data/doc/rdoc/classes/String.html +0 -212
  30. data/doc/rdoc/classes/Symbol.html +0 -158
  31. data/doc/rdoc/created.rid +0 -1
  32. data/doc/rdoc/files/CHANGELOG.html +0 -356
  33. data/doc/rdoc/files/COPYING.html +0 -129
  34. data/doc/rdoc/files/README.html +0 -199
  35. data/doc/rdoc/files/lib/serverside/application_rb.html +0 -109
  36. data/doc/rdoc/files/lib/serverside/cluster_rb.html +0 -101
  37. data/doc/rdoc/files/lib/serverside/connection_rb.html +0 -101
  38. data/doc/rdoc/files/lib/serverside/core_ext_rb.html +0 -107
  39. data/doc/rdoc/files/lib/serverside/daemon_rb.html +0 -108
  40. data/doc/rdoc/files/lib/serverside/request_rb.html +0 -108
  41. data/doc/rdoc/files/lib/serverside/routing_rb.html +0 -101
  42. data/doc/rdoc/files/lib/serverside/server_rb.html +0 -108
  43. data/doc/rdoc/files/lib/serverside/static_rb.html +0 -108
  44. data/doc/rdoc/files/lib/serverside/template_rb.html +0 -108
  45. data/doc/rdoc/files/lib/serverside_rb.html +0 -131
  46. data/doc/rdoc/fr_class_index.html +0 -45
  47. data/doc/rdoc/fr_file_index.html +0 -40
  48. data/doc/rdoc/fr_method_index.html +0 -79
  49. data/doc/rdoc/index.html +0 -24
  50. data/doc/rdoc/rdoc-style.css +0 -208
@@ -1,158 +0,0 @@
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: Symbol</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">Symbol</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../files/lib/serverside/core_ext_rb.html">
59
- lib/serverside/core_ext.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="Object.html">
69
- Object
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 href="Symbol.html">Symbol</a> extensions and overrides.
86
- </p>
87
-
88
- </div>
89
-
90
-
91
- </div>
92
-
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000001">to_s</a>&nbsp;&nbsp;
98
- </div>
99
- </div>
100
-
101
- </div>
102
-
103
-
104
- <!-- if includes -->
105
-
106
- <div id="section">
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
- <!-- if method_list -->
116
- <div id="methods">
117
- <h3 class="section-bar">Public Instance methods</h3>
118
-
119
- <div id="method-M000001" class="method-detail">
120
- <a name="M000001"></a>
121
-
122
- <div class="method-heading">
123
- <a href="#M000001" class="method-signature">
124
- <span class="method-name">to_s</span><span class="method-args">()</span>
125
- </a>
126
- </div>
127
-
128
- <div class="method-description">
129
- <p>
130
- A faster <a href="Symbol.html#M000001">to_s</a> method. This is called a
131
- lot, and memoization gives us performance between 10%-35% better.
132
- </p>
133
- <p><a class="source-toggle" href="#"
134
- onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
135
- <div class="method-source-code" id="M000001-source">
136
- <pre>
137
- <span class="ruby-comment cmt"># File lib/serverside/core_ext.rb, line 24</span>
138
- 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
139
- 25: <span class="ruby-ivar">@_to_s</span> <span class="ruby-operator">||</span> (<span class="ruby-ivar">@_to_s</span> = <span class="ruby-identifier">id2name</span>)
140
- 26: <span class="ruby-keyword kw">end</span>
141
- </pre>
142
- </div>
143
- </div>
144
- </div>
145
-
146
-
147
- </div>
148
-
149
-
150
- </div>
151
-
152
-
153
- <div id="validator-badges">
154
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
155
- </div>
156
-
157
- </body>
158
- </html>
data/doc/rdoc/created.rid DELETED
@@ -1 +0,0 @@
1
- Wed Oct 11 10:16:55 IST 2006
@@ -1,356 +0,0 @@
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: CHANGELOG</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>CHANGELOG</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>CHANGELOG
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Wed Oct 11 10:16:23 IST 2006</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
- <h2>0.2.7</h2>
73
- <ul>
74
- <li>Wrote spec for HTTP::Connection.
75
-
76
- </li>
77
- <li>Added spec files to rake stats reporting.
78
-
79
- </li>
80
- <li>Changed @conn to @socket in both HTTP::Connection and HTTP::Request for
81
- better readability.
82
-
83
- </li>
84
- <li>Wrote functional test for request body (but at least some of the testing
85
- should be in a unit test.)
86
-
87
- </li>
88
- <li>Added request body parsing (both URL-encoded and multipart.)
89
-
90
- </li>
91
- <li>Moved all HTTP::Const constants into HTTP::Request.
92
-
93
- </li>
94
- <li>Added Date to response headers. This is needed for caching to work
95
- correctly.
96
-
97
- </li>
98
- <li>Fixed bug in serverside script that caused an exception when specifying
99
- port number.
100
-
101
- </li>
102
- </ul>
103
- <h2>0.2.6</h2>
104
- <ul>
105
- <li>Refactored HTTP-related code into a new HTTP::Request class and a
106
- simplified HTTP::Connection.
107
-
108
- </li>
109
- <li>Another small change to docs.
110
-
111
- </li>
112
- <li>Fixed small error in Rakefile that prevented doc_rforge task from updating
113
- the docs.
114
-
115
- </li>
116
- <li>Fixed minor documentation error.
117
-
118
- </li>
119
- </ul>
120
- <h2>0.2.5</h2>
121
- <ul>
122
- <li>Added template serving to static file module.
123
-
124
- </li>
125
- <li>Wrote a simple ERB template system.
126
-
127
- </li>
128
- <li>More documentation tweaks.
129
-
130
- </li>
131
- <li>Changed how response cookies are formatted for somewhat better performance.
132
-
133
- </li>
134
- <li>Updated documentation.
135
-
136
- </li>
137
- <li>Removed deprecated code in lib/serverside/application.rb.
138
-
139
- </li>
140
- <li>Added HTTP cookie functionality (parse, set and delete.)
141
-
142
- </li>
143
- <li>Updated rakefile to include a spec task, as well as an rcov task. Updated
144
- test task to include spec and rcov tasks.
145
-
146
- </li>
147
- <li>Started writing RSpec tests. This looks like a very interesting concept.
148
-
149
- </li>
150
- <li>Added /test/spec directory.
151
-
152
- </li>
153
- </ul>
154
- <h2>0.2.0</h2>
155
- <ul>
156
- <li>Updated RFuzz script to work, but it doesn&#8217;t still do anything
157
- interesting.
158
-
159
- </li>
160
- <li>Added a serve command to serverside script.
161
-
162
- </li>
163
- <li>Changed substition of embedded parameters from (.*) to (.+).
164
-
165
- </li>
166
- <li>Added rule compilation after setting the default handler.
167
-
168
- </li>
169
- <li>Added doc_rforge rake task (for updating the docs on rubyforge.org).
170
-
171
- </li>
172
- <li>Added stats and svn_add rake tasks.
173
-
174
- </li>
175
- <li>Fixed routing unit tests.
176
-
177
- </li>
178
- <li>Added Router.has_routes? method.
179
-
180
- </li>
181
- <li>Finished unit tests for routing.
182
-
183
- </li>
184
- <li>Added Connection::Base.redirect.
185
-
186
- </li>
187
- <li>Added routing code from /research/routing, implemented functional test.
188
-
189
- </li>
190
- <li>Learned about the (?:) modifier and fixed the request parsing regexp.
191
-
192
- </li>
193
- <li>Added a profiled version of a static server -
194
- /test/functional/static_profile.rb.
195
-
196
- </li>
197
- <li>Added freezing of HTTP headers.
198
-
199
- </li>
200
- <li>Small change to documentation.
201
-
202
- </li>
203
- <li>Changed filename for cluster pid file to serverside_cluster.pid.
204
-
205
- </li>
206
- <li>Added documentation.
207
-
208
- </li>
209
- <li>Fixed require in serverside script to load the gem.
210
-
211
- </li>
212
- <li>Fixed the <a href="../classes/Daemon.html">Daemon</a> pid file for static
213
- file server mode.
214
-
215
- </li>
216
- <li>Added directory listing to static file server.
217
-
218
- </li>
219
- <li>Fixed request header parsing Regexp so a trailing slash would be ignored.
220
-
221
- </li>
222
- <li>Added static application. Using the binary script in static mode works.
223
-
224
- </li>
225
- <li>Added cluster class with unit tests.
226
-
227
- </li>
228
- <li>Added unit tests for static server.
229
-
230
- </li>
231
- <li>Added static server functional test.
232
-
233
- </li>
234
- <li>Added static file serving code.
235
-
236
- </li>
237
- <li>Renamed ServerSide::Request to ServerSide::Connection. This is more
238
- appropriate.
239
-
240
- </li>
241
- <li>Added functional static server test.
242
-
243
- </li>
244
- <li>Added test/functional for functional tests. Updated Rakefile.
245
-
246
- </li>
247
- <li>Added Request.send_response and stream.
248
-
249
- </li>
250
- <li>Added faster <a href="../classes/Symbol.html#M000001">Symbol.to_s</a> to
251
- core_ext.
252
-
253
- </li>
254
- <li>Added HTTP parsing code with unit tests.
255
-
256
- </li>
257
- <li>More unit tests for application code.
258
-
259
- </li>
260
- <li>Basic server code works with unit tests.
261
-
262
- </li>
263
- <li>Added option parsing to serverside script.
264
-
265
- </li>
266
- <li>Added daemon code and unit tests.
267
-
268
- </li>
269
- </ul>
270
- <h2>0.1</h2>
271
- <ul>
272
- <li>Added host attribute to Controller::Request.
273
-
274
- </li>
275
- <li>Added ability to create rules on any request attribute, not just path.
276
-
277
- </li>
278
- <li>Added ability to mount controllers with a block for a rule.
279
-
280
- </li>
281
- <li>Wrote object extensions to create frozen constants on the fly.
282
-
283
- </li>
284
- <li>Changed DirHandler to use frozen strings for cache header.
285
-
286
- </li>
287
- <li>Hooked Mongrel server to Controller::Router.
288
-
289
- </li>
290
- <li>Imported request code with unit tests.
291
-
292
- </li>
293
- <li>Wrote unit tests for daemon module.
294
-
295
- </li>
296
- <li>Wrote unit tests for controller routing code.
297
-
298
- </li>
299
- <li>Refactored controller routing code.
300
-
301
- </li>
302
- <li>Imported unit tests for extensions.
303
-
304
- </li>
305
- <li>Created Rakefile.
306
-
307
- </li>
308
- <li>Prototypical routing code.
309
-
310
- </li>
311
- <li>Fixed location of daemon pid files.
312
-
313
- </li>
314
- <li>Imported Mongrel code from Reality project.
315
-
316
- </li>
317
- <li>Imported extensions from Reality project.
318
-
319
- </li>
320
- <li>Implemented daemon and server cluster.
321
-
322
- </li>
323
- </ul>
324
-
325
- </div>
326
-
327
-
328
- </div>
329
-
330
-
331
- </div>
332
-
333
-
334
- <!-- if includes -->
335
-
336
- <div id="section">
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
- <!-- if method_list -->
346
-
347
-
348
- </div>
349
-
350
-
351
- <div id="validator-badges">
352
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
353
- </div>
354
-
355
- </body>
356
- </html>
@@ -1,129 +0,0 @@
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: COPYING</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>COPYING</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>COPYING
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Wed Aug 16 11:52:20 IDT 2006</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
- Copyright &#169; 2006 Sharon Rosner
74
- </p>
75
- <p>
76
- Permission is hereby granted, free of charge, to any person obtaining a
77
- copy of this software and associated documentation files (the
78
- &quot;Software&quot;), to deal in the Software without restriction,
79
- including without limitation the rights to use, copy, modify, merge,
80
- publish, distribute, sublicense, and/or sell copies of the Software, and to
81
- permit persons to whom the Software is furnished to do so, subject to the
82
- following conditions:
83
- </p>
84
- <p>
85
- The above copyright notice and this permission notice shall be included in
86
- all copies or substantial portions of the Software.
87
- </p>
88
- <p>
89
- THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
90
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
91
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
92
- NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
94
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
95
- DEALINGS IN THE SOFTWARE.
96
- </p>
97
-
98
- </div>
99
-
100
-
101
- </div>
102
-
103
-
104
- </div>
105
-
106
-
107
- <!-- if includes -->
108
-
109
- <div id="section">
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
- <!-- if method_list -->
119
-
120
-
121
- </div>
122
-
123
-
124
- <div id="validator-badges">
125
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
126
- </div>
127
-
128
- </body>
129
- </html>