rainbows 0.94.0 → 0.95.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/.document +1 -0
  2. data/.manifest +18 -0
  3. data/ChangeLog +394 -226
  4. data/GIT-VERSION-FILE +1 -1
  5. data/GIT-VERSION-GEN +1 -1
  6. data/GNUmakefile +6 -4
  7. data/NEWS +18 -0
  8. data/README +13 -5
  9. data/Static_Files +71 -0
  10. data/TODO +12 -0
  11. data/Test_Suite +1 -1
  12. data/bin/rainbows +1 -4
  13. data/lib/rainbows/actor_spawn.rb +1 -1
  14. data/lib/rainbows/app_pool.rb +1 -1
  15. data/lib/rainbows/base.rb +79 -89
  16. data/lib/rainbows/byte_slice.rb +17 -0
  17. data/lib/rainbows/configurator.rb +46 -0
  18. data/lib/rainbows/const.rb +2 -2
  19. data/lib/rainbows/dev_fd_response.rb +52 -44
  20. data/lib/rainbows/error.rb +1 -0
  21. data/lib/rainbows/ev_core.rb +3 -2
  22. data/lib/rainbows/event_machine.rb +26 -24
  23. data/lib/rainbows/fiber/base.rb +30 -40
  24. data/lib/rainbows/fiber/body.rb +34 -0
  25. data/lib/rainbows/fiber/io.rb +28 -8
  26. data/lib/rainbows/fiber/queue.rb +1 -0
  27. data/lib/rainbows/fiber/rev.rb +4 -2
  28. data/lib/rainbows/fiber.rb +1 -0
  29. data/lib/rainbows/fiber_pool.rb +2 -2
  30. data/lib/rainbows/fiber_spawn.rb +2 -2
  31. data/lib/rainbows/http_response.rb +20 -31
  32. data/lib/rainbows/http_server.rb +3 -4
  33. data/lib/rainbows/max_body.rb +1 -0
  34. data/lib/rainbows/never_block/event_machine.rb +2 -0
  35. data/lib/rainbows/never_block.rb +5 -4
  36. data/lib/rainbows/queue_pool.rb +1 -0
  37. data/lib/rainbows/response/body.rb +119 -0
  38. data/lib/rainbows/response.rb +43 -0
  39. data/lib/rainbows/rev/client.rb +79 -9
  40. data/lib/rainbows/rev/core.rb +4 -0
  41. data/lib/rainbows/rev/deferred_response.rb +1 -44
  42. data/lib/rainbows/rev/heartbeat.rb +1 -0
  43. data/lib/rainbows/rev/master.rb +1 -0
  44. data/lib/rainbows/rev/sendfile.rb +26 -0
  45. data/lib/rainbows/rev/thread.rb +2 -1
  46. data/lib/rainbows/rev.rb +2 -0
  47. data/lib/rainbows/rev_fiber_spawn.rb +3 -1
  48. data/lib/rainbows/rev_thread_pool.rb +7 -5
  49. data/lib/rainbows/rev_thread_spawn.rb +2 -2
  50. data/lib/rainbows/revactor.rb +146 -146
  51. data/lib/rainbows/sendfile.rb +10 -21
  52. data/lib/rainbows/server_token.rb +39 -0
  53. data/lib/rainbows/stream_file.rb +14 -0
  54. data/lib/rainbows/tee_input.rb +1 -0
  55. data/lib/rainbows/thread_pool.rb +12 -7
  56. data/lib/rainbows/thread_spawn.rb +2 -3
  57. data/lib/rainbows/writer_thread_pool.rb +13 -7
  58. data/lib/rainbows/writer_thread_spawn.rb +12 -9
  59. data/lib/rainbows.rb +16 -45
  60. data/rainbows.gemspec +8 -8
  61. data/t/.gitignore +1 -1
  62. data/t/GNUmakefile +26 -16
  63. data/t/README +1 -1
  64. data/t/async-response-no-autochunk.ru +0 -1
  65. data/t/async-response.ru +0 -1
  66. data/t/cramp/rainsocket.ru +26 -0
  67. data/t/fork-sleep.ru +0 -1
  68. data/t/my-tap-lib.sh +3 -2
  69. data/t/simple-http_ActorSpawn.ru +9 -0
  70. data/t/t0009-broken-app.sh +1 -1
  71. data/t/t0009.ru +0 -1
  72. data/t/t0011-close-on-exec-set.sh +1 -1
  73. data/t/t0015-working_directory.sh +56 -0
  74. data/t/t0016-onenine-encoding-is-tricky.sh +28 -0
  75. data/t/t0016.rb +15 -0
  76. data/t/t0020-large-sendfile-response.sh +141 -0
  77. data/t/t0300-async_sinatra.sh +0 -6
  78. data/t/t0501-cramp-rainsocket.sh +38 -0
  79. data/t/t9001-sendfile-to-path.sh +5 -4
  80. data/t/t9002-server-token.sh +37 -0
  81. data/t/t9002.ru +4 -0
  82. data/t/test-lib.sh +1 -1
  83. data/t/test_isolate.rb +14 -11
  84. metadata +87 -18
@@ -4,25 +4,26 @@
4
4
  t_plan 7 "Sendfile middleware test for $model"
5
5
 
6
6
  t_begin "configure and start" && {
7
- rtmpfiles curl_out curl_err
7
+ rtmpfiles curl_err
8
8
  rainbows_setup
9
9
 
10
10
  # do not allow default middleware to be loaded since it may
11
11
  # kill body#to_path
12
12
  rainbows -E none -D t9001.ru -c $unicorn_config
13
13
  rainbows_wait_start
14
+ random_blob_sha1=$(rsha1 < random_blob)
14
15
  }
15
16
 
16
17
  t_begin "hit with curl" && {
17
- curl -sSfv http://$listen/ > $curl_out 2> $curl_err
18
+ sha1=$(curl -sSfv http://$listen/ 2> $curl_err | rsha1)
18
19
  }
19
20
 
20
21
  t_begin "kill server" && {
21
22
  kill $rainbows_pid
22
23
  }
23
24
 
24
- t_begin "file matches source" && {
25
- cmp $curl_out random_blob
25
+ t_begin "SHA1 matches source" && {
26
+ test x$random_blob_sha1 = x$sha1
26
27
  }
27
28
 
28
29
  t_begin "no errors in Rainbows! stderr" && {
@@ -0,0 +1,37 @@
1
+ #!/bin/sh
2
+ . ./test-lib.sh
3
+ case $model in
4
+ Base) ;;
5
+ *) exit 0 ;; # don't waste cycles on trivial stuff :P
6
+ esac
7
+
8
+ t_plan 6 "ServerToken Rack middleware test for $model"
9
+
10
+ t_begin "configure and start" && {
11
+ rtmpfiles curl_out curl_err
12
+ rainbows_setup
13
+ rainbows -D t9002.ru -c $unicorn_config
14
+ rainbows_wait_start
15
+ }
16
+
17
+ t_begin "hit with curl" && {
18
+ curl -sSfiI http://$listen/ > $curl_out 2> $curl_err
19
+ }
20
+
21
+ t_begin "kill server" && {
22
+ kill $rainbows_pid
23
+ }
24
+
25
+ t_begin "no errors in curl stderr" && {
26
+ test ! -s $curl_err
27
+ }
28
+
29
+ t_begin "no errors in Rainbows! stderr" && {
30
+ check_stderr
31
+ }
32
+
33
+ t_begin "Server: token added" && {
34
+ grep Server: $curl_out
35
+ }
36
+
37
+ t_done
data/t/t9002.ru ADDED
@@ -0,0 +1,4 @@
1
+ require 'rainbows/server_token'
2
+ require 'rack/lobster'
3
+ use Rainbows::ServerToken
4
+ run Rack::Lobster.new
data/t/test-lib.sh CHANGED
@@ -19,7 +19,7 @@ fi
19
19
  set -e
20
20
  RUBY="${RUBY-ruby}"
21
21
  RUBY_VERSION=${RUBY_VERSION-$($RUBY -e 'puts RUBY_VERSION')}
22
- t_pfx=$PWD/trash/$model.$T-$RUBY_VERSION
22
+ t_pfx=$PWD/trash/$model.$T-$RUBY_ENGINE-$RUBY_VERSION
23
23
  set -u
24
24
 
25
25
  PATH=$PWD/bin:$PATH
data/t/test_isolate.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'isolate'
3
+ engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
3
4
 
4
- path = "tmp/isolate/ruby-#{RUBY_VERSION}"
5
+ path = "tmp/isolate/#{engine}-#{RUBY_VERSION}"
5
6
  opts = {
6
7
  :system => false,
7
8
  # we want "ruby-1.8.7" and not "ruby-1.8", so disable multiruby
@@ -14,25 +15,27 @@ $stdout.reopen($stderr)
14
15
 
15
16
  Isolate.now!(opts) do
16
17
  gem 'rack', '1.1.0'
17
- gem 'unicorn', '0.99.0'
18
+ gem 'unicorn', '1.1.0'
18
19
 
19
- gem 'iobuffer', '0.1.3'
20
- gem 'rev', '0.3.2'
20
+ if engine == "ruby"
21
+ gem 'sendfile', '1.0.0' # next Rubinius should support this
21
22
 
22
- gem 'eventmachine', '0.12.10'
23
+ gem 'iobuffer', '0.1.3'
24
+ gem 'rev', '0.3.2'
23
25
 
24
- gem 'sinatra', '0.9.4'
25
- gem 'async_sinatra', '0.1.5'
26
+ gem 'eventmachine', '0.12.10'
27
+ gem 'sinatra', '1.0.0'
28
+ gem 'async_sinatra', '0.2.1'
26
29
 
27
- gem 'neverblock', '0.1.6.2'
30
+ gem 'neverblock', '0.1.6.2'
31
+ gem 'cramp', '0.11'
32
+ end
28
33
 
29
- if defined?(::Fiber)
34
+ if defined?(::Fiber) && engine == "ruby"
30
35
  gem 'case', '0.5'
31
36
  gem 'revactor', '0.1.5'
32
37
  gem 'rack-fiber_pool', '0.9.0'
33
38
  end
34
-
35
- gem 'cramp', '0.11'
36
39
  end
37
40
 
38
41
  $stdout.reopen(old_out)
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rainbows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.94.0
4
+ hash: 355
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 95
9
+ - 0
10
+ version: 0.95.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - Rainbows! hackers
@@ -9,38 +15,68 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-06-04 00:00:00 +00:00
18
+ date: 2010-07-10 00:00:00 +00:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
- name: unicorn
22
+ name: rack
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 1
33
+ version: "1.1"
17
34
  type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: unicorn
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
20
41
  requirements:
21
42
  - - ">="
22
43
  - !ruby/object:Gem::Version
23
- version: 0.97.1
44
+ hash: 19
45
+ segments:
46
+ - 1
47
+ - 1
48
+ - 0
49
+ version: 1.1.0
24
50
  - - <
25
51
  - !ruby/object:Gem::Version
52
+ hash: 15
53
+ segments:
54
+ - 2
55
+ - 0
56
+ - 0
26
57
  version: 2.0.0
27
- version:
58
+ type: :runtime
59
+ version_requirements: *id002
28
60
  - !ruby/object:Gem::Dependency
29
61
  name: isolate
30
- type: :development
31
- version_requirement:
32
- version_requirements: !ruby/object:Gem::Requirement
62
+ prerelease: false
63
+ requirement: &id003 !ruby/object:Gem::Requirement
64
+ none: false
33
65
  requirements:
34
66
  - - ~>
35
67
  - !ruby/object:Gem::Version
36
- version: 2.0.2
37
- version:
68
+ hash: 11
69
+ segments:
70
+ - 2
71
+ - 1
72
+ - 0
73
+ version: 2.1.0
74
+ type: :development
75
+ version_requirements: *id003
38
76
  description: |-
39
77
  \Rainbows! is an HTTP server for sleepy Rack applications. It is based on
40
78
  Unicorn, but designed to handle applications that expect long
41
- request/response times and/or slow clients. For Rack applications not
42
- heavily bound by slow external network dependencies, consider Unicorn
43
- instead as it simpler and easier to debug.
79
+ request/response times and/or slow clients.
44
80
  email: rainbows-talk@rubyforge.org
45
81
  executables:
46
82
  - rainbows
@@ -54,6 +90,8 @@ extra_rdoc_files:
54
90
  - lib/rainbows/actor_spawn.rb
55
91
  - lib/rainbows/app_pool.rb
56
92
  - lib/rainbows/base.rb
93
+ - lib/rainbows/byte_slice.rb
94
+ - lib/rainbows/configurator.rb
57
95
  - lib/rainbows/const.rb
58
96
  - lib/rainbows/dev_fd_response.rb
59
97
  - lib/rainbows/error.rb
@@ -61,6 +99,7 @@ extra_rdoc_files:
61
99
  - lib/rainbows/event_machine.rb
62
100
  - lib/rainbows/fiber.rb
63
101
  - lib/rainbows/fiber/base.rb
102
+ - lib/rainbows/fiber/body.rb
64
103
  - lib/rainbows/fiber/io.rb
65
104
  - lib/rainbows/fiber/queue.rb
66
105
  - lib/rainbows/fiber/rev.rb
@@ -72,18 +111,23 @@ extra_rdoc_files:
72
111
  - lib/rainbows/never_block.rb
73
112
  - lib/rainbows/never_block/event_machine.rb
74
113
  - lib/rainbows/queue_pool.rb
114
+ - lib/rainbows/response.rb
115
+ - lib/rainbows/response/body.rb
75
116
  - lib/rainbows/rev.rb
76
117
  - lib/rainbows/rev/client.rb
77
118
  - lib/rainbows/rev/core.rb
78
119
  - lib/rainbows/rev/deferred_response.rb
79
120
  - lib/rainbows/rev/heartbeat.rb
80
121
  - lib/rainbows/rev/master.rb
122
+ - lib/rainbows/rev/sendfile.rb
81
123
  - lib/rainbows/rev/thread.rb
82
124
  - lib/rainbows/rev_fiber_spawn.rb
83
125
  - lib/rainbows/rev_thread_pool.rb
84
126
  - lib/rainbows/rev_thread_spawn.rb
85
127
  - lib/rainbows/revactor.rb
86
128
  - lib/rainbows/sendfile.rb
129
+ - lib/rainbows/server_token.rb
130
+ - lib/rainbows/stream_file.rb
87
131
  - lib/rainbows/tee_input.rb
88
132
  - lib/rainbows/thread_pool.rb
89
133
  - lib/rainbows/thread_spawn.rb
@@ -98,6 +142,7 @@ extra_rdoc_files:
98
142
  - vs_Unicorn
99
143
  - Summary
100
144
  - Test_Suite
145
+ - Static_Files
101
146
  files:
102
147
  - .document
103
148
  - .gitignore
@@ -119,6 +164,7 @@ files:
119
164
  - README
120
165
  - Rakefile
121
166
  - SIGNALS
167
+ - Static_Files
122
168
  - Summary
123
169
  - TODO
124
170
  - TUNING
@@ -128,6 +174,8 @@ files:
128
174
  - lib/rainbows/actor_spawn.rb
129
175
  - lib/rainbows/app_pool.rb
130
176
  - lib/rainbows/base.rb
177
+ - lib/rainbows/byte_slice.rb
178
+ - lib/rainbows/configurator.rb
131
179
  - lib/rainbows/const.rb
132
180
  - lib/rainbows/dev_fd_response.rb
133
181
  - lib/rainbows/error.rb
@@ -135,6 +183,7 @@ files:
135
183
  - lib/rainbows/event_machine.rb
136
184
  - lib/rainbows/fiber.rb
137
185
  - lib/rainbows/fiber/base.rb
186
+ - lib/rainbows/fiber/body.rb
138
187
  - lib/rainbows/fiber/io.rb
139
188
  - lib/rainbows/fiber/queue.rb
140
189
  - lib/rainbows/fiber/rev.rb
@@ -146,18 +195,23 @@ files:
146
195
  - lib/rainbows/never_block.rb
147
196
  - lib/rainbows/never_block/event_machine.rb
148
197
  - lib/rainbows/queue_pool.rb
198
+ - lib/rainbows/response.rb
199
+ - lib/rainbows/response/body.rb
149
200
  - lib/rainbows/rev.rb
150
201
  - lib/rainbows/rev/client.rb
151
202
  - lib/rainbows/rev/core.rb
152
203
  - lib/rainbows/rev/deferred_response.rb
153
204
  - lib/rainbows/rev/heartbeat.rb
154
205
  - lib/rainbows/rev/master.rb
206
+ - lib/rainbows/rev/sendfile.rb
155
207
  - lib/rainbows/rev/thread.rb
156
208
  - lib/rainbows/rev_fiber_spawn.rb
157
209
  - lib/rainbows/rev_thread_pool.rb
158
210
  - lib/rainbows/rev_thread_spawn.rb
159
211
  - lib/rainbows/revactor.rb
160
212
  - lib/rainbows/sendfile.rb
213
+ - lib/rainbows/server_token.rb
214
+ - lib/rainbows/stream_file.rb
161
215
  - lib/rainbows/tee_input.rb
162
216
  - lib/rainbows/thread_pool.rb
163
217
  - lib/rainbows/thread_spawn.rb
@@ -183,6 +237,7 @@ files:
183
237
  - t/bin/utee
184
238
  - t/content-md5.ru
185
239
  - t/cramp/README
240
+ - t/cramp/rainsocket.ru
186
241
  - t/cramp/streaming.ru
187
242
  - t/env.ru
188
243
  - t/env_rack_env.ru
@@ -193,6 +248,7 @@ files:
193
248
  - t/rack-fiber_pool/app.ru
194
249
  - t/sha1-random-size.ru
195
250
  - t/sha1.ru
251
+ - t/simple-http_ActorSpawn.ru
196
252
  - t/simple-http_Base.ru
197
253
  - t/simple-http_EventMachine.ru
198
254
  - t/simple-http_FiberPool.ru
@@ -226,6 +282,10 @@ files:
226
282
  - t/t0012-spurious-wakeups-quiet.sh
227
283
  - t/t0013-reload-bad-config.sh
228
284
  - t/t0014-config-conflict.sh
285
+ - t/t0015-working_directory.sh
286
+ - t/t0016-onenine-encoding-is-tricky.sh
287
+ - t/t0016.rb
288
+ - t/t0020-large-sendfile-response.sh
229
289
  - t/t0100-rack-input-hammer-chunked.sh
230
290
  - t/t0100-rack-input-hammer-content-length.sh
231
291
  - t/t0101-rack-input-trailer.sh
@@ -239,12 +299,15 @@ files:
239
299
  - t/t0400-em-async-app.sh
240
300
  - t/t0401-em-async-tailer.sh
241
301
  - t/t0500-cramp-streaming.sh
302
+ - t/t0501-cramp-rainsocket.sh
242
303
  - t/t0600-rack-fiber_pool.sh
243
304
  - t/t0700-app-deferred.sh
244
305
  - t/t9000-rack-app-pool.sh
245
306
  - t/t9000.ru
246
307
  - t/t9001-sendfile-to-path.sh
247
308
  - t/t9001.ru
309
+ - t/t9002-server-token.sh
310
+ - t/t9002.ru
248
311
  - t/test-lib.sh
249
312
  - t/test_isolate.rb
250
313
  - t/worker-follows-master-to-death.ru
@@ -261,21 +324,27 @@ rdoc_options:
261
324
  require_paths:
262
325
  - lib
263
326
  required_ruby_version: !ruby/object:Gem::Requirement
327
+ none: false
264
328
  requirements:
265
329
  - - ">="
266
330
  - !ruby/object:Gem::Version
331
+ hash: 3
332
+ segments:
333
+ - 0
267
334
  version: "0"
268
- version:
269
335
  required_rubygems_version: !ruby/object:Gem::Requirement
336
+ none: false
270
337
  requirements:
271
338
  - - ">="
272
339
  - !ruby/object:Gem::Version
340
+ hash: 3
341
+ segments:
342
+ - 0
273
343
  version: "0"
274
- version:
275
344
  requirements: []
276
345
 
277
346
  rubyforge_project: rainbows
278
- rubygems_version: 1.3.5
347
+ rubygems_version: 1.3.7
279
348
  signing_key:
280
349
  specification_version: 3
281
350
  summary: Unicorn for sleepy apps and slow clients