mongrel2 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/ChangeLog +58 -29
- data/History.rdoc +11 -0
- data/README.rdoc +2 -1
- data/lib/mongrel2.rb +2 -2
- data/lib/mongrel2/connection.rb +11 -4
- data/lib/mongrel2/handler.rb +1 -1
- data/lib/mongrel2/httpresponse.rb +3 -2
- data/spec/mongrel2/connection_spec.rb +4 -0
- data/spec/mongrel2/httpresponse_spec.rb +8 -1
- metadata +26 -26
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,8 +1,39 @@
|
|
1
|
+
2011-09-27 Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
* .hgtags:
|
4
|
+
Added tag v0.3.1 for changeset 844ff1c3ef53
|
5
|
+
[f01c6e6098bb] [tip]
|
6
|
+
|
7
|
+
* .hgsigs:
|
8
|
+
Added signature for changeset dff90858f4cd
|
9
|
+
[844ff1c3ef53] [v0.3.1]
|
10
|
+
|
11
|
+
* History.rdoc, lib/mongrel2.rb:
|
12
|
+
Bump patch version, update history for release.
|
13
|
+
[dff90858f4cd]
|
14
|
+
|
15
|
+
* lib/mongrel2/httpresponse.rb, spec/mongrel2/httpresponse_spec.rb:
|
16
|
+
Report the size of the response body in bytes, not characters
|
17
|
+
[f41c8d38bb25]
|
18
|
+
|
19
|
+
* lib/mongrel2/handler.rb:
|
20
|
+
Report unhandled disconnect notices as INFO instead of WARN
|
21
|
+
[d5b3e7c4075e]
|
22
|
+
|
23
|
+
* lib/mongrel2/connection.rb, spec/mongrel2/connection_spec.rb:
|
24
|
+
Made a stringified connection show the useful parts of the inspect
|
25
|
+
output
|
26
|
+
[aa4b85dc3470]
|
27
|
+
|
28
|
+
* README.rdoc:
|
29
|
+
Made the synopsis in the README stand a little better on its own
|
30
|
+
[b26dbd8d93f9]
|
31
|
+
|
1
32
|
2011-09-23 Michael Granger <ged@FaerieMUD.org>
|
2
33
|
|
3
34
|
* .hgtags:
|
4
35
|
Added tag v0.3.0 for changeset 627526429d63
|
5
|
-
[9c054d0e96c0]
|
36
|
+
[9c054d0e96c0]
|
6
37
|
|
7
38
|
* .hgsigs:
|
8
39
|
Added signature for changeset 745c431bcc1b
|
@@ -129,7 +160,7 @@
|
|
129
160
|
|
130
161
|
* lib/mongrel2/constants.rb:
|
131
162
|
Whitespace fix; add missing HTTP::CONTINUE constant.
|
132
|
-
[3082d251f00c]
|
163
|
+
[3082d251f00c]
|
133
164
|
|
134
165
|
2011-09-18 Michael Granger <ged@FaerieMUD.org>
|
135
166
|
|
@@ -203,14 +234,18 @@
|
|
203
234
|
* Automated merge with ssh://deveiate.org/Ruby-Mongrel2
|
204
235
|
[2da76acfb8db]
|
205
236
|
|
206
|
-
* History.rdoc:
|
207
|
-
Updating History
|
208
|
-
[3b013d4918c6]
|
209
|
-
|
210
237
|
* Rakefile:
|
211
238
|
Automated merge with ssh://deveiate.org/Ruby-Mongrel2
|
212
239
|
[e3908fd8e744]
|
213
240
|
|
241
|
+
* Rakefile:
|
242
|
+
Remove ChangeLog task, since hoe-deveiate already does it
|
243
|
+
[5f4982a32949]
|
244
|
+
|
245
|
+
* History.rdoc:
|
246
|
+
Updating History
|
247
|
+
[3b013d4918c6]
|
248
|
+
|
214
249
|
* .hgtags:
|
215
250
|
Added tag v0.1.1 for changeset 42da048fe158
|
216
251
|
[2489be2693d5]
|
@@ -227,10 +262,6 @@
|
|
227
262
|
Updated rbzmq dependency
|
228
263
|
[758fe465780e]
|
229
264
|
|
230
|
-
* Rakefile:
|
231
|
-
Remove ChangeLog task, since hoe-deveiate already does it
|
232
|
-
[5f4982a32949]
|
233
|
-
|
234
265
|
* .hgtags:
|
235
266
|
Added tag v0.1.0 for changeset 55c8f01c01c6
|
236
267
|
[39b509c68142]
|
@@ -272,11 +303,15 @@
|
|
272
303
|
Merged with 3659a56af8fb
|
273
304
|
[f2201728e874]
|
274
305
|
|
306
|
+
* .hgignore:
|
307
|
+
Ignoring packaging directory
|
308
|
+
[0613976b6735]
|
309
|
+
|
275
310
|
2011-09-12 Michael Granger <ged@FaerieMUD.org>
|
276
311
|
|
277
312
|
* README.rdoc:
|
278
313
|
README fixes
|
279
|
-
[3659a56af8fb]
|
314
|
+
[3659a56af8fb] [github/master]
|
280
315
|
|
281
316
|
* Rakefile:
|
282
317
|
Fixing gem name
|
@@ -340,12 +375,6 @@
|
|
340
375
|
procedures.
|
341
376
|
[19e0a72320dd]
|
342
377
|
|
343
|
-
2011-09-13 Michael Granger <ged@FaerieMUD.org>
|
344
|
-
|
345
|
-
* .hgignore:
|
346
|
-
Ignoring packaging directory
|
347
|
-
[0613976b6735]
|
348
|
-
|
349
378
|
2011-09-10 Michael Granger <ged@FaerieMUD.org>
|
350
379
|
|
351
380
|
* bin/m2sh.rb:
|
@@ -386,6 +415,18 @@
|
|
386
415
|
* Merged with 6ea60b67e106
|
387
416
|
[6d5341f30cc4]
|
388
417
|
|
418
|
+
* Manifest.txt:
|
419
|
+
Updating the manifest for the first release
|
420
|
+
[916a79570cdc]
|
421
|
+
|
422
|
+
* examples/helloworld-handler.rb, lib/mongrel2/handler.rb:
|
423
|
+
More Handler API docs.
|
424
|
+
[47427db9b4fb]
|
425
|
+
|
426
|
+
* lib/mongrel2/handler.rb:
|
427
|
+
Adding some Mongrel2::Handler API docs.
|
428
|
+
[da95bfdf83da]
|
429
|
+
|
389
430
|
* lib/mongrel2/config/host.rb:
|
390
431
|
Adding a many_to_one association for the server belonging to a
|
391
432
|
Mongrel2::Config::Host
|
@@ -405,18 +446,6 @@
|
|
405
446
|
Adding a proftools dump of the requestdumper app
|
406
447
|
[00cbc1b89a61]
|
407
448
|
|
408
|
-
* Manifest.txt:
|
409
|
-
Updating the manifest for the first release
|
410
|
-
[916a79570cdc]
|
411
|
-
|
412
|
-
* examples/helloworld-handler.rb, lib/mongrel2/handler.rb:
|
413
|
-
More Handler API docs.
|
414
|
-
[47427db9b4fb]
|
415
|
-
|
416
|
-
* lib/mongrel2/handler.rb:
|
417
|
-
Adding some Mongrel2::Handler API docs.
|
418
|
-
[da95bfdf83da]
|
419
|
-
|
420
449
|
2011-09-08 Michael Granger <ged@FaerieMUD.org>
|
421
450
|
|
422
451
|
* README.rdoc, lib/mongrel2.rb, lib/mongrel2/config.rb,
|
data/History.rdoc
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
== v0.3.1 [2011-09-27] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
Bugfix:
|
4
|
+
- Measure the content-length of HTTPResponse in bytes, not characters.
|
5
|
+
- Log unhandled disconnect notices as INFO instead of WARN
|
6
|
+
|
7
|
+
Enhancements:
|
8
|
+
- Made a stringified connection show the useful parts of the inspect
|
9
|
+
output
|
10
|
+
|
11
|
+
|
1
12
|
== v0.3.0 [2011-09-23] Michael Granger <ged@FaerieMUD.org>
|
2
13
|
|
3
14
|
- Mongrel2::Client fixes/documentation updates.
|
data/README.rdoc
CHANGED
@@ -5,7 +5,8 @@
|
|
5
5
|
|
6
6
|
== Description
|
7
7
|
|
8
|
-
|
8
|
+
Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for
|
9
|
+
Mongrel2[http://mongrel2.org/].
|
9
10
|
|
10
11
|
This library includes configuration-database ORM classes, a Ruby
|
11
12
|
implementation of the 'm2sh' tool, a configuration DSL for generating config
|
data/lib/mongrel2.rb
CHANGED
@@ -14,10 +14,10 @@ module Mongrel2
|
|
14
14
|
abort "\n\n>>> Mongrel2 requires Ruby 1.9.2 or later. <<<\n\n" if RUBY_VERSION < '1.9.2'
|
15
15
|
|
16
16
|
# Library version constant
|
17
|
-
VERSION = '0.3.
|
17
|
+
VERSION = '0.3.1'
|
18
18
|
|
19
19
|
# Version-control revision constant
|
20
|
-
REVISION = %q$Revision:
|
20
|
+
REVISION = %q$Revision: dff90858f4cd $
|
21
21
|
|
22
22
|
|
23
23
|
require 'mongrel2/logging'
|
data/lib/mongrel2/connection.rb
CHANGED
@@ -168,6 +168,15 @@ class Mongrel2::Connection
|
|
168
168
|
end
|
169
169
|
|
170
170
|
|
171
|
+
### Return a string describing the connection.
|
172
|
+
def to_s
|
173
|
+
return "{%s} %s <-> %s" % [
|
174
|
+
self.app_id,
|
175
|
+
self.sub_addr,
|
176
|
+
self.pub_addr,
|
177
|
+
]
|
178
|
+
end
|
179
|
+
|
171
180
|
### Returns a string containing a human-readable representation of the Connection,
|
172
181
|
### suitable for debugging.
|
173
182
|
def inspect
|
@@ -181,12 +190,10 @@ class Mongrel2::Connection
|
|
181
190
|
"not connected"
|
182
191
|
end
|
183
192
|
|
184
|
-
return "#<%p:0x%016x
|
193
|
+
return "#<%p:0x%016x %s (%s)>" % [
|
185
194
|
self.class,
|
186
195
|
self.object_id * 2,
|
187
|
-
self.
|
188
|
-
self.sub_addr,
|
189
|
-
self.pub_addr,
|
196
|
+
self.to_s,
|
190
197
|
state,
|
191
198
|
]
|
192
199
|
end
|
data/lib/mongrel2/handler.rb
CHANGED
@@ -254,7 +254,7 @@ class Mongrel2::Handler
|
|
254
254
|
### Handle a disconnect notice from Mongrel2 via the given +request+. Its return value
|
255
255
|
### is ignored.
|
256
256
|
def handle_disconnect( request )
|
257
|
-
self.log.
|
257
|
+
self.log.info "Unhandled disconnect notice."
|
258
258
|
return nil
|
259
259
|
end
|
260
260
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
|
+
#encoding: utf-8
|
2
3
|
|
3
4
|
require 'time'
|
4
5
|
|
@@ -153,8 +154,8 @@ class Mongrel2::HTTPResponse < Mongrel2::Response
|
|
153
154
|
### one, or using #seek and #tell if it implements those. If neither of those are
|
154
155
|
### possible, an exception is raised.
|
155
156
|
def get_content_length
|
156
|
-
if @body.respond_to?( :
|
157
|
-
return @body.
|
157
|
+
if @body.respond_to?( :bytesize )
|
158
|
+
return @body.bytesize
|
158
159
|
elsif @body.respond_to?( :seek ) && @body.respond_to?( :tell )
|
159
160
|
starting_pos = @body.tell
|
160
161
|
@body.seek( 0, IO::SEEK_END )
|
@@ -68,6 +68,10 @@ describe Mongrel2::Connection do
|
|
68
68
|
@conn.response_sock.should == response_sock
|
69
69
|
end
|
70
70
|
|
71
|
+
it "stringifies as a description of the appid and both sockets" do
|
72
|
+
@conn.to_s.should == "{#{TEST_UUID}} #{TEST_SEND_SPEC} <-> #{TEST_RECV_SPEC}"
|
73
|
+
end
|
74
|
+
|
71
75
|
context "after a connection has been established" do
|
72
76
|
|
73
77
|
before( :each ) do
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#encoding: utf-8
|
2
3
|
|
3
4
|
BEGIN {
|
4
5
|
require 'pathname'
|
@@ -91,7 +92,6 @@ describe Mongrel2::HTTPResponse do
|
|
91
92
|
@response.headers.should have(1).keys
|
92
93
|
end
|
93
94
|
|
94
|
-
|
95
95
|
it "can find the length of its body if it's a String" do
|
96
96
|
test_body = 'A string full of stuff'
|
97
97
|
@response.body = test_body
|
@@ -99,6 +99,13 @@ describe Mongrel2::HTTPResponse do
|
|
99
99
|
@response.get_content_length.should == test_body.length
|
100
100
|
end
|
101
101
|
|
102
|
+
it "can find the length of its body if it's a String with multi-byte characters in it" do
|
103
|
+
test_body = 'Хорошая собака, Стрелке! Очень хорошо.'
|
104
|
+
@response.body = test_body
|
105
|
+
|
106
|
+
@response.get_content_length.should == test_body.bytesize
|
107
|
+
end
|
108
|
+
|
102
109
|
it "can find the length of its body if it's a seekable IO" do
|
103
110
|
test_body = File.open( __FILE__, 'r' )
|
104
111
|
test_body.seek( 0, IO::SEEK_END )
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongrel2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -48,11 +48,11 @@ cert_chain:
|
|
48
48
|
-----END CERTIFICATE-----
|
49
49
|
|
50
50
|
'
|
51
|
-
date: 2011-09-
|
51
|
+
date: 2011-09-27 00:00:00.000000000Z
|
52
52
|
dependencies:
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: nokogiri
|
55
|
-
requirement: &
|
55
|
+
requirement: &70313120993700 !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
57
57
|
requirements:
|
58
58
|
- - ~>
|
@@ -60,10 +60,10 @@ dependencies:
|
|
60
60
|
version: '1.5'
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
|
-
version_requirements: *
|
63
|
+
version_requirements: *70313120993700
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: sequel
|
66
|
-
requirement: &
|
66
|
+
requirement: &70313120992860 !ruby/object:Gem::Requirement
|
67
67
|
none: false
|
68
68
|
requirements:
|
69
69
|
- - ~>
|
@@ -71,10 +71,10 @@ dependencies:
|
|
71
71
|
version: '3.26'
|
72
72
|
type: :runtime
|
73
73
|
prerelease: false
|
74
|
-
version_requirements: *
|
74
|
+
version_requirements: *70313120992860
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: amalgalite
|
77
|
-
requirement: &
|
77
|
+
requirement: &70313120991440 !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
@@ -82,10 +82,10 @@ dependencies:
|
|
82
82
|
version: '1.1'
|
83
83
|
type: :runtime
|
84
84
|
prerelease: false
|
85
|
-
version_requirements: *
|
85
|
+
version_requirements: *70313120991440
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: tnetstring
|
88
|
-
requirement: &
|
88
|
+
requirement: &70313120989920 !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
@@ -93,10 +93,10 @@ dependencies:
|
|
93
93
|
version: '0.3'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
|
-
version_requirements: *
|
96
|
+
version_requirements: *70313120989920
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: yajl-ruby
|
99
|
-
requirement: &
|
99
|
+
requirement: &70313120988900 !ruby/object:Gem::Requirement
|
100
100
|
none: false
|
101
101
|
requirements:
|
102
102
|
- - ~>
|
@@ -104,10 +104,10 @@ dependencies:
|
|
104
104
|
version: '0.8'
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
|
-
version_requirements: *
|
107
|
+
version_requirements: *70313120988900
|
108
108
|
- !ruby/object:Gem::Dependency
|
109
109
|
name: zmq
|
110
|
-
requirement: &
|
110
|
+
requirement: &70313120987840 !ruby/object:Gem::Requirement
|
111
111
|
none: false
|
112
112
|
requirements:
|
113
113
|
- - ~>
|
@@ -115,10 +115,10 @@ dependencies:
|
|
115
115
|
version: 2.1.4
|
116
116
|
type: :runtime
|
117
117
|
prerelease: false
|
118
|
-
version_requirements: *
|
118
|
+
version_requirements: *70313120987840
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: hoe-mercurial
|
121
|
-
requirement: &
|
121
|
+
requirement: &70313120986520 !ruby/object:Gem::Requirement
|
122
122
|
none: false
|
123
123
|
requirements:
|
124
124
|
- - ~>
|
@@ -126,10 +126,10 @@ dependencies:
|
|
126
126
|
version: 1.3.0
|
127
127
|
type: :development
|
128
128
|
prerelease: false
|
129
|
-
version_requirements: *
|
129
|
+
version_requirements: *70313120986520
|
130
130
|
- !ruby/object:Gem::Dependency
|
131
131
|
name: hoe-highline
|
132
|
-
requirement: &
|
132
|
+
requirement: &70313120985540 !ruby/object:Gem::Requirement
|
133
133
|
none: false
|
134
134
|
requirements:
|
135
135
|
- - ~>
|
@@ -137,10 +137,10 @@ dependencies:
|
|
137
137
|
version: 0.0.1
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
|
-
version_requirements: *
|
140
|
+
version_requirements: *70313120985540
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: configurability
|
143
|
-
requirement: &
|
143
|
+
requirement: &70313120984540 !ruby/object:Gem::Requirement
|
144
144
|
none: false
|
145
145
|
requirements:
|
146
146
|
- - ~>
|
@@ -148,10 +148,10 @@ dependencies:
|
|
148
148
|
version: '1.0'
|
149
149
|
type: :development
|
150
150
|
prerelease: false
|
151
|
-
version_requirements: *
|
151
|
+
version_requirements: *70313120984540
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: rspec
|
154
|
-
requirement: &
|
154
|
+
requirement: &70313120983260 !ruby/object:Gem::Requirement
|
155
155
|
none: false
|
156
156
|
requirements:
|
157
157
|
- - ~>
|
@@ -159,10 +159,10 @@ dependencies:
|
|
159
159
|
version: '2.4'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
|
-
version_requirements: *
|
162
|
+
version_requirements: *70313120983260
|
163
163
|
- !ruby/object:Gem::Dependency
|
164
164
|
name: hoe
|
165
|
-
requirement: &
|
165
|
+
requirement: &70313120963540 !ruby/object:Gem::Requirement
|
166
166
|
none: false
|
167
167
|
requirements:
|
168
168
|
- - ~>
|
@@ -170,8 +170,8 @@ dependencies:
|
|
170
170
|
version: '2.12'
|
171
171
|
type: :development
|
172
172
|
prerelease: false
|
173
|
-
version_requirements: *
|
174
|
-
description: ! "
|
173
|
+
version_requirements: *70313120963540
|
174
|
+
description: ! "Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for \nMongrel2[http://mongrel2.org/].\n\nThis
|
175
175
|
library includes configuration-database ORM classes, a Ruby\nimplementation of the
|
176
176
|
'm2sh' tool, a configuration DSL for generating config\ndatabases in pure Ruby,
|
177
177
|
a Control port interface object, and handler classes \nfor creating applications
|
@@ -295,5 +295,5 @@ rubyforge_project: mongrel2
|
|
295
295
|
rubygems_version: 1.8.10
|
296
296
|
signing_key:
|
297
297
|
specification_version: 3
|
298
|
-
summary:
|
298
|
+
summary: Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for Mongrel2[http://mongrel2.org/]
|
299
299
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|