serverside 0.2.0 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/CHANGELOG +26 -0
  2. data/README +39 -22
  3. data/Rakefile +18 -2
  4. data/bin/serverside +21 -5
  5. data/doc/rdoc/classes/ServerSide/Application.html +12 -19
  6. data/doc/rdoc/classes/ServerSide/Connection/Base.html +203 -116
  7. data/doc/rdoc/classes/ServerSide/Connection/Const.html +35 -5
  8. data/doc/rdoc/classes/ServerSide/Connection/Router.html +107 -78
  9. data/doc/rdoc/classes/ServerSide/Server.html +1 -1
  10. data/doc/rdoc/classes/ServerSide/StaticFiles/Const.html +10 -0
  11. data/doc/rdoc/classes/ServerSide/StaticFiles.html +73 -43
  12. data/doc/rdoc/classes/ServerSide/Template.html +200 -0
  13. data/doc/rdoc/classes/ServerSide.html +13 -8
  14. data/doc/rdoc/created.rid +1 -1
  15. data/doc/rdoc/files/CHANGELOG.html +44 -1
  16. data/doc/rdoc/files/README.html +63 -35
  17. data/doc/rdoc/files/lib/serverside/application_rb.html +1 -1
  18. data/doc/rdoc/files/lib/serverside/connection_rb.html +1 -1
  19. data/doc/rdoc/files/lib/serverside/routing_rb.html +1 -1
  20. data/doc/rdoc/files/lib/serverside/server_rb.html +1 -1
  21. data/doc/rdoc/files/lib/serverside/static_rb.html +1 -1
  22. data/doc/rdoc/files/lib/serverside/template_rb.html +108 -0
  23. data/doc/rdoc/fr_class_index.html +1 -2
  24. data/doc/rdoc/fr_file_index.html +1 -0
  25. data/doc/rdoc/fr_method_index.html +18 -16
  26. data/lib/serverside/application.rb +0 -28
  27. data/lib/serverside/connection.rb +38 -12
  28. data/lib/serverside/routing.rb +23 -2
  29. data/lib/serverside/server.rb +1 -1
  30. data/lib/serverside/static.rb +12 -0
  31. data/lib/serverside/template.rb +36 -0
  32. data/test/functional/primitive_static_server_test.rb +26 -2
  33. data/test/functional/static_rfuzz.rb +3 -39
  34. data/test/spec/core_ext_spec.rb +68 -0
  35. data/test/unit/connection_test.rb +37 -1
  36. data/test/unit/template_test.rb +78 -0
  37. metadata +8 -6
  38. data/doc/rdoc/classes/ServerSide/Application/Base.html +0 -196
  39. data/doc/rdoc/classes/ServerSide/Application/Static.html +0 -156
  40. data/test/unit/application_test.rb +0 -16
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: serverside
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2006-08-28 00:00:00 +03:00
6
+ version: 0.2.5
7
+ date: 2006-09-03 00:00:00 +03:00
8
8
  summary: Performance-oriented web framework.
9
9
  require_paths:
10
10
  - lib
@@ -55,6 +55,7 @@ files:
55
55
  - doc/rdoc/files/lib/serverside/cluster_rb.html
56
56
  - doc/rdoc/files/lib/serverside/static_rb.html
57
57
  - doc/rdoc/files/lib/serverside/routing_rb.html
58
+ - doc/rdoc/files/lib/serverside/template_rb.html
58
59
  - doc/rdoc/classes/Symbol.html
59
60
  - doc/rdoc/classes/Proc.html
60
61
  - doc/rdoc/classes/Object.html
@@ -71,33 +72,33 @@ files:
71
72
  - doc/rdoc/classes/ServerSide/StaticFiles.html
72
73
  - doc/rdoc/classes/ServerSide/StaticFiles
73
74
  - doc/rdoc/classes/ServerSide/Application.html
74
- - doc/rdoc/classes/ServerSide/Application
75
75
  - doc/rdoc/classes/ServerSide/Connection.html
76
76
  - doc/rdoc/classes/ServerSide/Connection
77
77
  - doc/rdoc/classes/ServerSide/Server.html
78
+ - doc/rdoc/classes/ServerSide/Template.html
78
79
  - doc/rdoc/classes/ServerSide/StaticFiles/Const.html
79
- - doc/rdoc/classes/ServerSide/Application/Base.html
80
- - doc/rdoc/classes/ServerSide/Application/Static.html
81
80
  - doc/rdoc/classes/ServerSide/Connection/Const.html
82
81
  - doc/rdoc/classes/ServerSide/Connection/Base.html
83
82
  - doc/rdoc/classes/ServerSide/Connection/Router.html
84
83
  - test/unit
85
84
  - test/test_helper.rb
86
85
  - test/functional
86
+ - test/spec
87
87
  - test/unit/daemon_test.rb
88
- - test/unit/application_test.rb
89
88
  - test/unit/server_test.rb
90
89
  - test/unit/core_ext_test.rb
91
90
  - test/unit/connection_test.rb
92
91
  - test/unit/cluster_test.rb
93
92
  - test/unit/static_test.rb
94
93
  - test/unit/routing_test.rb
94
+ - test/unit/template_test.rb
95
95
  - test/functional/primitive_static_server_test.rb
96
96
  - test/functional/static_server_test.rb
97
97
  - test/functional/static_profile.rb
98
98
  - test/functional/static_rfuzz.rb
99
99
  - test/functional/routing_server.rb
100
100
  - test/functional/routing_server_test.rb
101
+ - test/spec/core_ext_spec.rb
101
102
  - lib/serverside.rb
102
103
  - lib/serverside
103
104
  - lib/serverside/server.rb
@@ -108,6 +109,7 @@ files:
108
109
  - lib/serverside/cluster.rb
109
110
  - lib/serverside/static.rb
110
111
  - lib/serverside/routing.rb
112
+ - lib/serverside/template.rb
111
113
  - CHANGELOG
112
114
  test_files: []
113
115
 
@@ -1,196 +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: 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="#M000030">configuration</a>&nbsp;&nbsp;
92
- <a href="#M000029">configure</a>&nbsp;&nbsp;
93
- <a href="#M000031">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-M000030" class="method-detail">
116
- <a name="M000030"></a>
117
-
118
- <div class="method-heading">
119
- <a href="#M000030" 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('M000030-source');return false;">[Source]</a></p>
127
- <div class="method-source-code" id="M000030-source">
128
- <pre>
129
- <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 30</span>
130
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">configuration</span>
131
- 31: <span class="ruby-ivar">@config</span>
132
- 32: <span class="ruby-keyword kw">end</span>
133
- </pre>
134
- </div>
135
- </div>
136
- </div>
137
-
138
- <div id="method-M000029" class="method-detail">
139
- <a name="M000029"></a>
140
-
141
- <div class="method-heading">
142
- <a href="#M000029" 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('M000029-source');return false;">[Source]</a></p>
150
- <div class="method-source-code" id="M000029-source">
151
- <pre>
152
- <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 26</span>
153
- 26: <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
- 27: <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">options</span>
155
- 28: <span class="ruby-keyword kw">end</span>
156
- </pre>
157
- </div>
158
- </div>
159
- </div>
160
-
161
- <div id="method-M000031" class="method-detail">
162
- <a name="M000031"></a>
163
-
164
- <div class="method-heading">
165
- <a href="#M000031" 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('M000031-source');return false;">[Source]</a></p>
173
- <div class="method-source-code" id="M000031-source">
174
- <pre>
175
- <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 34</span>
176
- 34: <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
- 35: <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
- 36: <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>
@@ -1,156 +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: 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
- <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="#M000032">daemonize</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 Class methods</h3>
112
-
113
- <div id="method-M000032" class="method-detail">
114
- <a name="M000032"></a>
115
-
116
- <div class="method-heading">
117
- <a href="#M000032" class="method-signature">
118
- <span class="method-name">daemonize</span><span class="method-args">(config, cmd)</span>
119
- </a>
120
- </div>
121
-
122
- <div class="method-description">
123
- <p><a class="source-toggle" href="#"
124
- onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
125
- <div class="method-source-code" id="M000032-source">
126
- <pre>
127
- <span class="ruby-comment cmt"># File lib/serverside/application.rb, line 40</span>
128
- 40: <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>)
129
- 41: <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>
130
- 42: <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>}
131
- 43: <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>
132
- 44: <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>)
133
- 45: <span class="ruby-keyword kw">end</span>
134
- 46: <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>]}
135
- 47: <span class="ruby-keyword kw">end</span>
136
- 48:
137
- 49: <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>)
138
- 50: <span class="ruby-keyword kw">end</span>
139
- </pre>
140
- </div>
141
- </div>
142
- </div>
143
-
144
-
145
- </div>
146
-
147
-
148
- </div>
149
-
150
-
151
- <div id="validator-badges">
152
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
153
- </div>
154
-
155
- </body>
156
- </html>
@@ -1,16 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class ApplicationTest < Test::Unit::TestCase
4
- class App1 < ServerSide::Application::Base
5
- configure(:port => 8001)
6
- end
7
-
8
- class App2 < ServerSide::Application::Base
9
- configure(:port => 8002)
10
- end
11
-
12
- def test_config
13
- assert_equal 8001, App1.configuration[:port]
14
- assert_equal 8002, App2.configuration[:port]
15
- end
16
- end