serverside 0.1.59

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/CHANGELOG +97 -0
  2. data/COPYING +18 -0
  3. data/README +51 -0
  4. data/Rakefile +92 -0
  5. data/bin/serverside +74 -0
  6. data/doc/rdoc/classes/Daemon.html +253 -0
  7. data/doc/rdoc/classes/Daemon/Base.html +146 -0
  8. data/doc/rdoc/classes/Daemon/Cluster.html +308 -0
  9. data/doc/rdoc/classes/Daemon/Cluster/PidFile.html +228 -0
  10. data/doc/rdoc/classes/Daemon/PidFile.html +178 -0
  11. data/doc/rdoc/classes/ServerSide.html +160 -0
  12. data/doc/rdoc/classes/ServerSide/Application.html +147 -0
  13. data/doc/rdoc/classes/ServerSide/Application/Base.html +196 -0
  14. data/doc/rdoc/classes/ServerSide/Application/Static.html +154 -0
  15. data/doc/rdoc/classes/ServerSide/Connection.html +128 -0
  16. data/doc/rdoc/classes/ServerSide/Connection/Base.html +343 -0
  17. data/doc/rdoc/classes/ServerSide/Connection/Const.html +229 -0
  18. data/doc/rdoc/classes/ServerSide/Connection/Static.html +172 -0
  19. data/doc/rdoc/classes/ServerSide/Server.html +162 -0
  20. data/doc/rdoc/classes/ServerSide/StaticFiles.html +208 -0
  21. data/doc/rdoc/classes/ServerSide/StaticFiles/Const.html +179 -0
  22. data/doc/rdoc/classes/String.html +210 -0
  23. data/doc/rdoc/classes/Symbol.html +156 -0
  24. data/doc/rdoc/created.rid +1 -0
  25. data/doc/rdoc/files/CHANGELOG.html +260 -0
  26. data/doc/rdoc/files/COPYING.html +129 -0
  27. data/doc/rdoc/files/README.html +171 -0
  28. data/doc/rdoc/files/lib/serverside/application_rb.html +109 -0
  29. data/doc/rdoc/files/lib/serverside/cluster_rb.html +101 -0
  30. data/doc/rdoc/files/lib/serverside/connection_rb.html +101 -0
  31. data/doc/rdoc/files/lib/serverside/core_ext_rb.html +107 -0
  32. data/doc/rdoc/files/lib/serverside/daemon_rb.html +108 -0
  33. data/doc/rdoc/files/lib/serverside/server_rb.html +108 -0
  34. data/doc/rdoc/files/lib/serverside/static_rb.html +101 -0
  35. data/doc/rdoc/files/lib/serverside_rb.html +131 -0
  36. data/doc/rdoc/fr_class_index.html +44 -0
  37. data/doc/rdoc/fr_file_index.html +37 -0
  38. data/doc/rdoc/fr_method_index.html +60 -0
  39. data/doc/rdoc/index.html +24 -0
  40. data/doc/rdoc/rdoc-style.css +208 -0
  41. data/lib/serverside.rb +13 -0
  42. data/lib/serverside/application.rb +40 -0
  43. data/lib/serverside/cluster.rb +72 -0
  44. data/lib/serverside/connection.rb +115 -0
  45. data/lib/serverside/core_ext.rb +27 -0
  46. data/lib/serverside/daemon.rb +67 -0
  47. data/lib/serverside/server.rb +18 -0
  48. data/lib/serverside/static.rb +96 -0
  49. data/test/functional/primitive_static_server_test.rb +37 -0
  50. data/test/functional/static_profile.rb +17 -0
  51. data/test/functional/static_rfuzz.rb +67 -0
  52. data/test/functional/static_server_test.rb +25 -0
  53. data/test/test_helper.rb +2 -0
  54. data/test/unit/application_test.rb +16 -0
  55. data/test/unit/cluster_test.rb +129 -0
  56. data/test/unit/connection_test.rb +193 -0
  57. data/test/unit/core_ext_test.rb +32 -0
  58. data/test/unit/daemon_test.rb +75 -0
  59. data/test/unit/server_test.rb +26 -0
  60. data/test/unit/static_test.rb +143 -0
  61. metadata +140 -0
@@ -0,0 +1,147 @@
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>Module: ServerSide::Application</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>Module</strong></td>
53
+ <td class="class-name-in-header">ServerSide::Application</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/serverside/application_rb.html">
59
+ lib/serverside/application.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000022">daemonize</a>&nbsp;&nbsp;
84
+ </div>
85
+ </div>
86
+
87
+ </div>
88
+
89
+
90
+ <!-- if includes -->
91
+
92
+ <div id="section">
93
+
94
+ <div id="class-list">
95
+ <h3 class="section-bar">Classes and Modules</h3>
96
+
97
+ Class <a href="Application/Base.html" class="link">ServerSide::Application::Base</a><br />
98
+ Class <a href="Application/Static.html" class="link">ServerSide::Application::Static</a><br />
99
+
100
+ </div>
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ <!-- if method_list -->
109
+ <div id="methods">
110
+ <h3 class="section-bar">Public Class methods</h3>
111
+
112
+ <div id="method-M000022" class="method-detail">
113
+ <a name="M000022"></a>
114
+
115
+ <div class="method-heading">
116
+ <a href="#M000022" class="method-signature">
117
+ <span class="method-name">daemonize</span><span class="method-args">()</span>
118
+ </a>
119
+ </div>
120
+
121
+ <div class="method-description">
122
+ <p><a class="source-toggle" href="#"
123
+ onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
124
+ <div class="method-source-code" id="M000022-source">
125
+ <pre>
126
+ <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 36</span>
127
+ 36: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">daemonize</span>
128
+ 37:
129
+ 38: <span class="ruby-keyword kw">end</span>
130
+ </pre>
131
+ </div>
132
+ </div>
133
+ </div>
134
+
135
+
136
+ </div>
137
+
138
+
139
+ </div>
140
+
141
+
142
+ <div id="validator-badges">
143
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
144
+ </div>
145
+
146
+ </body>
147
+ </html>
@@ -0,0 +1,196 @@
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: ServerSide::Application::Base</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">ServerSide::Application::Base</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/serverside/application_rb.html">
59
+ lib/serverside/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="../Connection/Base.html">
69
+ ServerSide::Connection::Base
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="#M000024">configuration</a>&nbsp;&nbsp;
92
+ <a href="#M000023">configure</a>&nbsp;&nbsp;
93
+ <a href="#M000025">new</a>&nbsp;&nbsp;
94
+ </div>
95
+ </div>
96
+
97
+ </div>
98
+
99
+
100
+ <!-- if includes -->
101
+
102
+ <div id="section">
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ <!-- if method_list -->
112
+ <div id="methods">
113
+ <h3 class="section-bar">Public Class methods</h3>
114
+
115
+ <div id="method-M000024" class="method-detail">
116
+ <a name="M000024"></a>
117
+
118
+ <div class="method-heading">
119
+ <a href="#M000024" class="method-signature">
120
+ <span class="method-name">configuration</span><span class="method-args">()</span>
121
+ </a>
122
+ </div>
123
+
124
+ <div class="method-description">
125
+ <p><a class="source-toggle" href="#"
126
+ onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
127
+ <div class="method-source-code" id="M000024-source">
128
+ <pre>
129
+ <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 13</span>
130
+ 13: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">configuration</span>
131
+ 14: <span class="ruby-ivar">@config</span>
132
+ 15: <span class="ruby-keyword kw">end</span>
133
+ </pre>
134
+ </div>
135
+ </div>
136
+ </div>
137
+
138
+ <div id="method-M000023" class="method-detail">
139
+ <a name="M000023"></a>
140
+
141
+ <div class="method-heading">
142
+ <a href="#M000023" class="method-signature">
143
+ <span class="method-name">configure</span><span class="method-args">(options)</span>
144
+ </a>
145
+ </div>
146
+
147
+ <div class="method-description">
148
+ <p><a class="source-toggle" href="#"
149
+ onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
150
+ <div class="method-source-code" id="M000023-source">
151
+ <pre>
152
+ <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 9</span>
153
+ 9: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-identifier">options</span>)
154
+ 10: <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">options</span>
155
+ 11: <span class="ruby-keyword kw">end</span>
156
+ </pre>
157
+ </div>
158
+ </div>
159
+ </div>
160
+
161
+ <div id="method-M000025" class="method-detail">
162
+ <a name="M000025"></a>
163
+
164
+ <div class="method-heading">
165
+ <a href="#M000025" class="method-signature">
166
+ <span class="method-name">new</span><span class="method-args">(host, port)</span>
167
+ </a>
168
+ </div>
169
+
170
+ <div class="method-description">
171
+ <p><a class="source-toggle" href="#"
172
+ onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
173
+ <div class="method-source-code" id="M000025-source">
174
+ <pre>
175
+ <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 17</span>
176
+ 17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
177
+ 18: <span class="ruby-constant">ServerSide</span><span class="ruby-operator">::</span><span class="ruby-constant">Server</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">make_request_class</span>)
178
+ 19: <span class="ruby-keyword kw">end</span>
179
+ </pre>
180
+ </div>
181
+ </div>
182
+ </div>
183
+
184
+
185
+ </div>
186
+
187
+
188
+ </div>
189
+
190
+
191
+ <div id="validator-badges">
192
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
193
+ </div>
194
+
195
+ </body>
196
+ </html>
@@ -0,0 +1,154 @@
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: ServerSide::Application::Static</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">ServerSide::Application::Static</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../files/lib/serverside/application_rb.html">
59
+ lib/serverside/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
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="method-list">
86
+ <h3 class="section-bar">Methods</h3>
87
+
88
+ <div class="name-list">
89
+ <a href="#M000026">daemonize</a>&nbsp;&nbsp;
90
+ </div>
91
+ </div>
92
+
93
+ </div>
94
+
95
+
96
+ <!-- if includes -->
97
+
98
+ <div id="section">
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+ <!-- if method_list -->
108
+ <div id="methods">
109
+ <h3 class="section-bar">Public Class methods</h3>
110
+
111
+ <div id="method-M000026" class="method-detail">
112
+ <a name="M000026"></a>
113
+
114
+ <div class="method-heading">
115
+ <a href="#M000026" class="method-signature">
116
+ <span class="method-name">daemonize</span><span class="method-args">(config, cmd)</span>
117
+ </a>
118
+ </div>
119
+
120
+ <div class="method-description">
121
+ <p><a class="source-toggle" href="#"
122
+ onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
123
+ <div class="method-source-code" id="M000026-source">
124
+ <pre>
125
+ <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 23</span>
126
+ 23: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">daemonize</span>(<span class="ruby-identifier">config</span>, <span class="ruby-identifier">cmd</span>)
127
+ 24: <span class="ruby-identifier">daemon_class</span> = <span class="ruby-constant">Class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Daemon</span><span class="ruby-operator">::</span><span class="ruby-constant">Cluster</span>) <span class="ruby-keyword kw">do</span>
128
+ 25: <span class="ruby-identifier">meta_def</span>(<span class="ruby-identifier">:pid_fn</span>) {<span class="ruby-constant">Daemon</span><span class="ruby-operator">::</span><span class="ruby-constant">WorkingDirectory</span><span class="ruby-operator">/</span><span class="ruby-value str">'serverside.pid'</span>}
129
+ 26: <span class="ruby-identifier">meta_def</span>(<span class="ruby-identifier">:server_loop</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">port</span><span class="ruby-operator">|</span>
130
+ 27: <span class="ruby-constant">ServerSide</span><span class="ruby-operator">::</span><span class="ruby-constant">Server</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">config</span>[<span class="ruby-identifier">:host</span>], <span class="ruby-identifier">port</span>, <span class="ruby-constant">ServerSide</span><span class="ruby-operator">::</span><span class="ruby-constant">Connection</span><span class="ruby-operator">::</span><span class="ruby-constant">Static</span>)
131
+ 28: <span class="ruby-keyword kw">end</span>
132
+ 29: <span class="ruby-identifier">meta_def</span>(<span class="ruby-identifier">:ports</span>) {<span class="ruby-identifier">$cmd_config</span>[<span class="ruby-identifier">:ports</span>]}
133
+ 30: <span class="ruby-keyword kw">end</span>
134
+ 31:
135
+ 32: <span class="ruby-constant">Daemon</span>.<span class="ruby-identifier">control</span>(<span class="ruby-identifier">daemon_class</span>, <span class="ruby-identifier">cmd</span>)
136
+ 33: <span class="ruby-keyword kw">end</span>
137
+ </pre>
138
+ </div>
139
+ </div>
140
+ </div>
141
+
142
+
143
+ </div>
144
+
145
+
146
+ </div>
147
+
148
+
149
+ <div id="validator-badges">
150
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
151
+ </div>
152
+
153
+ </body>
154
+ </html>