serverside 0.1.59 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/CHANGELOG +21 -1
  2. data/Rakefile +69 -40
  3. data/bin/serverside +7 -15
  4. data/doc/rdoc/classes/Daemon.html +18 -18
  5. data/doc/rdoc/classes/Daemon/Base.html +8 -6
  6. data/doc/rdoc/classes/Daemon/Cluster.html +36 -36
  7. data/doc/rdoc/classes/Daemon/Cluster/PidFile.html +20 -18
  8. data/doc/rdoc/classes/Daemon/PidFile.html +12 -12
  9. data/doc/rdoc/classes/Object.html +151 -0
  10. data/doc/rdoc/classes/Proc.html +151 -0
  11. data/doc/rdoc/classes/ServerSide.html +69 -0
  12. data/doc/rdoc/classes/ServerSide/Application.html +43 -11
  13. data/doc/rdoc/classes/ServerSide/Application/Base.html +30 -30
  14. data/doc/rdoc/classes/ServerSide/Application/Static.html +20 -18
  15. data/doc/rdoc/classes/ServerSide/Connection.html +3 -3
  16. data/doc/rdoc/classes/ServerSide/Connection/Base.html +142 -99
  17. data/doc/rdoc/classes/ServerSide/Connection/Const.html +11 -13
  18. data/doc/rdoc/classes/ServerSide/Connection/Router.html +464 -0
  19. data/doc/rdoc/classes/ServerSide/Server.html +8 -6
  20. data/doc/rdoc/classes/ServerSide/StaticFiles.html +75 -43
  21. data/doc/rdoc/classes/ServerSide/StaticFiles/Const.html +5 -0
  22. data/doc/rdoc/classes/String.html +20 -18
  23. data/doc/rdoc/classes/Symbol.html +2 -0
  24. data/doc/rdoc/created.rid +1 -1
  25. data/doc/rdoc/files/CHANGELOG.html +32 -2
  26. data/doc/rdoc/files/lib/serverside/application_rb.html +1 -1
  27. data/doc/rdoc/files/lib/serverside/connection_rb.html +1 -1
  28. data/doc/rdoc/files/lib/serverside/core_ext_rb.html +1 -1
  29. data/doc/rdoc/files/lib/serverside/daemon_rb.html +1 -1
  30. data/doc/rdoc/files/lib/serverside/routing_rb.html +101 -0
  31. data/doc/rdoc/files/lib/serverside/static_rb.html +1 -1
  32. data/doc/rdoc/fr_class_index.html +3 -1
  33. data/doc/rdoc/fr_file_index.html +1 -0
  34. data/doc/rdoc/fr_method_index.html +49 -33
  35. data/lib/serverside/application.rb +17 -4
  36. data/lib/serverside/connection.rb +23 -3
  37. data/lib/serverside/core_ext.rb +16 -1
  38. data/lib/serverside/routing.rb +119 -0
  39. data/lib/serverside/static.rb +9 -23
  40. data/test/functional/routing_server.rb +14 -0
  41. data/test/functional/routing_server_test.rb +41 -0
  42. data/test/functional/static_server_test.rb +8 -2
  43. data/test/unit/connection_test.rb +13 -0
  44. data/test/unit/core_ext_test.rb +14 -0
  45. data/test/unit/routing_test.rb +171 -0
  46. data/test/unit/static_test.rb +34 -1
  47. metadata +10 -3
  48. data/doc/rdoc/classes/ServerSide/Connection/Static.html +0 -172
@@ -65,7 +65,9 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
+ <a href="../../Object.html">
68
69
  Object
70
+ </a>
69
71
  </td>
70
72
  </tr>
71
73
  </table>
@@ -92,9 +94,9 @@ Stores and recalls pids for the child processes.
92
94
  <h3 class="section-bar">Methods</h3>
93
95
 
94
96
  <div class="name-list">
95
- <a href="#M000017">delete</a>&nbsp;&nbsp;
96
- <a href="#M000019">recall_pids</a>&nbsp;&nbsp;
97
- <a href="#M000018">store_pid</a>&nbsp;&nbsp;
97
+ <a href="#M000019">delete</a>&nbsp;&nbsp;
98
+ <a href="#M000021">recall_pids</a>&nbsp;&nbsp;
99
+ <a href="#M000020">store_pid</a>&nbsp;&nbsp;
98
100
  </div>
99
101
  </div>
100
102
 
@@ -129,11 +131,11 @@ Stores and recalls pids for the child processes.
129
131
  <div id="methods">
130
132
  <h3 class="section-bar">Public Class methods</h3>
131
133
 
132
- <div id="method-M000017" class="method-detail">
133
- <a name="M000017"></a>
134
+ <div id="method-M000019" class="method-detail">
135
+ <a name="M000019"></a>
134
136
 
135
137
  <div class="method-heading">
136
- <a href="#M000017" class="method-signature">
138
+ <a href="#M000019" class="method-signature">
137
139
  <span class="method-name">delete</span><span class="method-args">()</span>
138
140
  </a>
139
141
  </div>
@@ -143,8 +145,8 @@ Stores and recalls pids for the child processes.
143
145
  Deletes the cluster&#8217;s pid file.
144
146
  </p>
145
147
  <p><a class="source-toggle" href="#"
146
- onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
147
- <div class="method-source-code" id="M000017-source">
148
+ onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
149
+ <div class="method-source-code" id="M000019-source">
148
150
  <pre>
149
151
  <span class="ruby-comment cmt"># File lib/serverside/cluster.rb, line 12</span>
150
152
  12: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete</span>
@@ -155,11 +157,11 @@ Deletes the cluster&#8217;s pid file.
155
157
  </div>
156
158
  </div>
157
159
 
158
- <div id="method-M000019" class="method-detail">
159
- <a name="M000019"></a>
160
+ <div id="method-M000021" class="method-detail">
161
+ <a name="M000021"></a>
160
162
 
161
163
  <div class="method-heading">
162
- <a href="#M000019" class="method-signature">
164
+ <a href="#M000021" class="method-signature">
163
165
  <span class="method-name">recall_pids</span><span class="method-args">()</span>
164
166
  </a>
165
167
  </div>
@@ -169,8 +171,8 @@ Deletes the cluster&#8217;s pid file.
169
171
  Recalls all child pids.
170
172
  </p>
171
173
  <p><a class="source-toggle" href="#"
172
- onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
173
- <div class="method-source-code" id="M000019-source">
174
+ onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
175
+ <div class="method-source-code" id="M000021-source">
174
176
  <pre>
175
177
  <span class="ruby-comment cmt"># File lib/serverside/cluster.rb, line 22</span>
176
178
  22: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">recall_pids</span>
@@ -187,11 +189,11 @@ Recalls all child pids.
187
189
  </div>
188
190
  </div>
189
191
 
190
- <div id="method-M000018" class="method-detail">
191
- <a name="M000018"></a>
192
+ <div id="method-M000020" class="method-detail">
193
+ <a name="M000020"></a>
192
194
 
193
195
  <div class="method-heading">
194
- <a href="#M000018" class="method-signature">
196
+ <a href="#M000020" class="method-signature">
195
197
  <span class="method-name">store_pid</span><span class="method-args">(pid)</span>
196
198
  </a>
197
199
  </div>
@@ -201,8 +203,8 @@ Recalls all child pids.
201
203
  Stores a pid in the cluster&#8217;s pid file.
202
204
  </p>
203
205
  <p><a class="source-toggle" href="#"
204
- onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
205
- <div class="method-source-code" id="M000018-source">
206
+ onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
207
+ <div class="method-source-code" id="M000020-source">
206
208
  <pre>
207
209
  <span class="ruby-comment cmt"># File lib/serverside/cluster.rb, line 17</span>
208
210
  17: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">store_pid</span>(<span class="ruby-identifier">pid</span>)
@@ -86,8 +86,8 @@ Stores and recalls the daemon pid.
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000009">recall</a>&nbsp;&nbsp;
90
- <a href="#M000008">store</a>&nbsp;&nbsp;
89
+ <a href="#M000011">recall</a>&nbsp;&nbsp;
90
+ <a href="#M000010">store</a>&nbsp;&nbsp;
91
91
  </div>
92
92
  </div>
93
93
 
@@ -109,11 +109,11 @@ Stores and recalls the daemon pid.
109
109
  <div id="methods">
110
110
  <h3 class="section-bar">Public Class methods</h3>
111
111
 
112
- <div id="method-M000009" class="method-detail">
113
- <a name="M000009"></a>
112
+ <div id="method-M000011" class="method-detail">
113
+ <a name="M000011"></a>
114
114
 
115
115
  <div class="method-heading">
116
- <a href="#M000009" class="method-signature">
116
+ <a href="#M000011" class="method-signature">
117
117
  <span class="method-name">recall</span><span class="method-args">(daemon)</span>
118
118
  </a>
119
119
  </div>
@@ -123,8 +123,8 @@ Stores and recalls the daemon pid.
123
123
  Recalls the daemon pid. If the pid can not be recalled, an error is raised.
124
124
  </p>
125
125
  <p><a class="source-toggle" href="#"
126
- onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
127
- <div class="method-source-code" id="M000009-source">
126
+ onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
127
+ <div class="method-source-code" id="M000011-source">
128
128
  <pre>
129
129
  <span class="ruby-comment cmt"># File lib/serverside/daemon.rb, line 22</span>
130
130
  22: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">recall</span>(<span class="ruby-identifier">daemon</span>)
@@ -137,11 +137,11 @@ Recalls the daemon pid. If the pid can not be recalled, an error is raised.
137
137
  </div>
138
138
  </div>
139
139
 
140
- <div id="method-M000008" class="method-detail">
141
- <a name="M000008"></a>
140
+ <div id="method-M000010" class="method-detail">
141
+ <a name="M000010"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="#M000008" class="method-signature">
144
+ <a href="#M000010" class="method-signature">
145
145
  <span class="method-name">store</span><span class="method-args">(daemon, pid)</span>
146
146
  </a>
147
147
  </div>
@@ -151,8 +151,8 @@ Recalls the daemon pid. If the pid can not be recalled, an error is raised.
151
151
  Stores the daemon pid.
152
152
  </p>
153
153
  <p><a class="source-toggle" href="#"
154
- onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
155
- <div class="method-source-code" id="M000008-source">
154
+ onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
155
+ <div class="method-source-code" id="M000010-source">
156
156
  <pre>
157
157
  <span class="ruby-comment cmt"># File lib/serverside/daemon.rb, line 16</span>
158
158
  16: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">store</span>(<span class="ruby-identifier">daemon</span>, <span class="ruby-identifier">pid</span>)
@@ -0,0 +1,151 @@
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: Object</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">Object</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
+
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="#M000003">const_tag</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-M000003" class="method-detail">
114
+ <a name="M000003"></a>
115
+
116
+ <div class="method-heading">
117
+ <a href="#M000003" class="method-signature">
118
+ <span class="method-name">const_tag</span><span class="method-args">()</span>
119
+ </a>
120
+ </div>
121
+
122
+ <div class="method-description">
123
+ <p>
124
+ Returns a unique tag for the object. This method is used by the router.
125
+ </p>
126
+ <p><a class="source-toggle" href="#"
127
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
128
+ <div class="method-source-code" id="M000003-source">
129
+ <pre>
130
+ <span class="ruby-comment cmt"># File lib/serverside/core_ext.rb, line 38</span>
131
+ 38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">const_tag</span>
132
+ 39: <span class="ruby-value str">'C'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">object_id</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">36</span>).<span class="ruby-identifier">upcase</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-value str">'-'</span>, <span class="ruby-value str">'_'</span>)
133
+ 40: <span class="ruby-keyword kw">end</span>
134
+ </pre>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+
143
+ </div>
144
+
145
+
146
+ <div id="validator-badges">
147
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
148
+ </div>
149
+
150
+ </body>
151
+ </html>
@@ -0,0 +1,151 @@
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: Proc</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">Proc</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
+
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="#M000002">proc_tag</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-M000002" class="method-detail">
114
+ <a name="M000002"></a>
115
+
116
+ <div class="method-heading">
117
+ <a href="#M000002" class="method-signature">
118
+ <span class="method-name">proc_tag</span><span class="method-args">()</span>
119
+ </a>
120
+ </div>
121
+
122
+ <div class="method-description">
123
+ <p>
124
+ Returns a unique proc tag. This method is used by the router.
125
+ </p>
126
+ <p><a class="source-toggle" href="#"
127
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
128
+ <div class="method-source-code" id="M000002-source">
129
+ <pre>
130
+ <span class="ruby-comment cmt"># File lib/serverside/core_ext.rb, line 31</span>
131
+ 31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">proc_tag</span>
132
+ 32: <span class="ruby-value str">'proc_'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">object_id</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">36</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-value str">'-'</span>, <span class="ruby-value str">'_'</span>)
133
+ 33: <span class="ruby-keyword kw">end</span>
134
+ </pre>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+
143
+ </div>
144
+
145
+
146
+ <div id="validator-badges">
147
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
148
+ </div>
149
+
150
+ </body>
151
+ </html>