mongrel2 0.19.0 → 0.20.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 +14 -2
- data/History.rdoc +23 -0
- data/Rakefile +2 -2
- data/lib/mongrel2.rb +2 -2
- data/lib/mongrel2/config.rb +19 -18
- data/spec/lib/helpers.rb +2 -3
- data/spec/mongrel2/config/route_spec.rb +1 -2
- data/spec/mongrel2/config_spec.rb +5 -4
- metadata +45 -45
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,12 +1,24 @@
|
|
1
1
|
2012-03-28 Michael Granger <ged@FaerieMUD.org>
|
2
2
|
|
3
|
+
* .hgtags:
|
4
|
+
Added tag v0.19.0 for changeset ddf2ba151fdc
|
5
|
+
[fc05d13761c5] [tip]
|
6
|
+
|
7
|
+
* .hgsigs:
|
8
|
+
Added signature for changeset a0a3115eb782
|
9
|
+
[ddf2ba151fdc] [v0.19.0]
|
10
|
+
|
11
|
+
* History.rdoc, lib/mongrel2.rb:
|
12
|
+
Bump minor version, update history.
|
13
|
+
[a0a3115eb782]
|
14
|
+
|
3
15
|
* lib/mongrel2/httpresponse.rb, spec/mongrel2/httpresponse_spec.rb:
|
4
16
|
Make HTTPResponse default to a 200 status if there's a body.
|
5
17
|
|
6
18
|
If there's a body, and the status hasn't yet been set, assume that
|
7
19
|
it's supposed to be 200 OK. If the body is nil or empty and the
|
8
20
|
status hasn't been set, assume it's a 204 No content.
|
9
|
-
[f1c2834b6d59] [
|
21
|
+
[f1c2834b6d59] [github/master]
|
10
22
|
|
11
23
|
* .hgtags:
|
12
24
|
Added tag v0.18.0 for changeset 4624c640343e
|
@@ -114,7 +126,7 @@
|
|
114
126
|
spec/mongrel2/httprequest_spec.rb, spec/mongrel2/request_spec.rb,
|
115
127
|
spec/mongrel2/websocket_spec.rb:
|
116
128
|
Adding WebSocket (RFC6455) support
|
117
|
-
[0db6f3808f5a]
|
129
|
+
[0db6f3808f5a]
|
118
130
|
|
119
131
|
2012-03-02 Michael Granger <ged@FaerieMUD.org>
|
120
132
|
|
data/History.rdoc
CHANGED
@@ -1,3 +1,26 @@
|
|
1
|
+
== v0.20.1 [2012-03-28] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
- Fix dependencies and the spec that fails when you run against the
|
4
|
+
version of Sequel I was trying to fix in the previous release.
|
5
|
+
|
6
|
+
|
7
|
+
== v0.20.0 [2012-03-28] Michael Granger <ged@FaerieMUD.org>
|
8
|
+
|
9
|
+
- Fix the config DB for Sequel 3.34.
|
10
|
+
|
11
|
+
Note: This fix includes several API changes
|
12
|
+
|
13
|
+
- Mongrel2::Config.adapter_method is now .sqlite_adapter, and just
|
14
|
+
returns the name of the appropriate adapter instead of a Method
|
15
|
+
object that returns a Sequel::Database.
|
16
|
+
- Mongrel2::Config.pathname is now .dbname, and returns either a URI
|
17
|
+
or a String, depending on how the database handle was created.
|
18
|
+
|
19
|
+
These changes also will make it easier to use alternative
|
20
|
+
configuration databases, e.g., when I get the PostgreSQL config
|
21
|
+
module working, it'll be easier to point the config model at it.
|
22
|
+
|
23
|
+
|
1
24
|
== v0.19.0 [2012-03-28] Michael Granger <ged@FaerieMUD.org>
|
2
25
|
|
3
26
|
- Make HTTPResponse default to a 200 status if there's a body.
|
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ hoespec = Hoe.spec 'mongrel2' do
|
|
26
26
|
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
27
27
|
|
28
28
|
self.dependency 'nokogiri', '~> 1.5'
|
29
|
-
self.dependency 'sequel', '~> 3.
|
29
|
+
self.dependency 'sequel', '~> 3.34'
|
30
30
|
self.dependency 'amalgalite', '~> 1.1'
|
31
31
|
self.dependency 'tnetstring', '~> 0.3'
|
32
32
|
self.dependency 'yajl-ruby', '~> 1.0'
|
@@ -36,7 +36,7 @@ hoespec = Hoe.spec 'mongrel2' do
|
|
36
36
|
|
37
37
|
self.dependency 'configurability', '~> 1.0', :developer
|
38
38
|
self.dependency 'simplecov', '~> 0.6', :developer
|
39
|
-
self.dependency '
|
39
|
+
self.dependency 'hoe-deveiate', '~> 0.1', :developer
|
40
40
|
|
41
41
|
self.spec_extras[:licenses] = ["BSD"]
|
42
42
|
self.require_ruby_version( '>= 1.9.2' )
|
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.
|
17
|
+
VERSION = '0.20.1'
|
18
18
|
|
19
19
|
# Version-control revision constant
|
20
|
-
REVISION = %q$Revision:
|
20
|
+
REVISION = %q$Revision: 55a458211cb9 $
|
21
21
|
|
22
22
|
|
23
23
|
require 'mongrel2/logging'
|
data/lib/mongrel2/config.rb
CHANGED
@@ -18,10 +18,10 @@ begin
|
|
18
18
|
require 'amalgalite'
|
19
19
|
# Rude hack to stop Sequel::Model from complaining if it's subclassed before
|
20
20
|
# the first database connection is established. Ugh.
|
21
|
-
Sequel::Model.db = Sequel.amalgalite if Sequel::DATABASES.empty?
|
21
|
+
Sequel::Model.db = Sequel.connect( 'amalgalite:/' ) if Sequel::DATABASES.empty?
|
22
22
|
rescue LoadError
|
23
23
|
require 'sqlite3'
|
24
|
-
Sequel::Model.db = Sequel.sqlite if Sequel::DATABASES.empty?
|
24
|
+
Sequel::Model.db = Sequel.connect( 'sqlite:/' ) if Sequel::DATABASES.empty?
|
25
25
|
end
|
26
26
|
|
27
27
|
|
@@ -85,22 +85,20 @@ module Mongrel2
|
|
85
85
|
lambda {|raw| TNetstring.parse( raw ).first} )
|
86
86
|
|
87
87
|
|
88
|
-
### Return
|
89
|
-
###
|
90
|
-
|
91
|
-
def self::adapter_method
|
88
|
+
### Return the name of the Sequel SQLite adapter to use. If the amalgalite library
|
89
|
+
### is available, this will return 'amalgalite', else it returns 'sqlite'.
|
90
|
+
def self::sqlite_adapter
|
92
91
|
if defined?( ::Amalgalite )
|
93
|
-
return
|
92
|
+
return 'amalgalite'
|
94
93
|
else
|
95
|
-
return
|
94
|
+
return 'sqlite'
|
96
95
|
end
|
97
96
|
end
|
98
97
|
|
99
98
|
|
100
99
|
### Return a Sequel::Database for an in-memory database via the available SQLite library
|
101
100
|
def self::in_memory_db
|
102
|
-
|
103
|
-
return self.adapter_method.call
|
101
|
+
return Sequel.connect( adapter: self.sqlite_adapter )
|
104
102
|
end
|
105
103
|
|
106
104
|
|
@@ -112,7 +110,7 @@ module Mongrel2
|
|
112
110
|
config = DEFAULTS.merge( config )
|
113
111
|
|
114
112
|
if config[ :configdb ]
|
115
|
-
self.db =
|
113
|
+
self.db = Sequel.connect( config[:configdb] )
|
116
114
|
end
|
117
115
|
end
|
118
116
|
|
@@ -197,14 +195,17 @@ module Mongrel2
|
|
197
195
|
end
|
198
196
|
|
199
197
|
|
200
|
-
### Return
|
198
|
+
### Return the name of the current config database, or nil if the current
|
201
199
|
### database is an in-memory one.
|
202
|
-
def self::
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
200
|
+
def self::dbname
|
201
|
+
Mongrel2.log.warn "Returning dbname from: %p" % [ self.db.opts ]
|
202
|
+
if self.db.opts[:dbname]
|
203
|
+
return self.db.opts[:dbname]
|
204
|
+
elsif self.db.uri
|
205
|
+
return URI( self.db.uri )
|
206
|
+
else
|
207
|
+
return nil
|
208
|
+
end
|
208
209
|
end
|
209
210
|
|
210
211
|
|
data/spec/lib/helpers.rb
CHANGED
@@ -117,9 +117,8 @@ module Mongrel2::SpecHelpers
|
|
117
117
|
|
118
118
|
|
119
119
|
### Set up a Mongrel2 configuration database in memory.
|
120
|
-
def setup_config_db
|
121
|
-
Mongrel2::Config.
|
122
|
-
Mongrel2::Config.db.uri[ %r{sqlite:/(.*)}, 1 ] == dbspec
|
120
|
+
def setup_config_db
|
121
|
+
Mongrel2::Config.db ||= Mongrel2::Config.in_memory_db
|
123
122
|
Mongrel2::Config.init_database
|
124
123
|
Mongrel2::Config.db.tables.collect {|t| Mongrel2::Config.db[t] }.each( &:truncate )
|
125
124
|
end
|
@@ -25,7 +25,7 @@ require 'mongrel2/config'
|
|
25
25
|
describe Mongrel2::Config do
|
26
26
|
|
27
27
|
before( :all ) do
|
28
|
-
setup_logging()
|
28
|
+
setup_logging( :fatal )
|
29
29
|
setup_config_db()
|
30
30
|
end
|
31
31
|
|
@@ -97,13 +97,14 @@ describe Mongrel2::Config do
|
|
97
97
|
end
|
98
98
|
|
99
99
|
it "can return the path to the config DB as a Pathname if it's pointing at a file" do
|
100
|
-
Mongrel2::Config.db =
|
101
|
-
|
100
|
+
Mongrel2::Config.db =
|
101
|
+
Sequel.connect( adapter: Mongrel2::Config.sqlite_adapter, dbname: 'config-spec.sqlite' )
|
102
|
+
Mongrel2::Config.dbname.should == 'config-spec.sqlite'
|
102
103
|
end
|
103
104
|
|
104
105
|
it "returns nil if asked for the pathname to an in-memory database" do
|
105
106
|
Mongrel2::Config.db = Mongrel2::Config.in_memory_db
|
106
|
-
Mongrel2::Config.
|
107
|
+
Mongrel2::Config.dbname.should be_nil()
|
107
108
|
end
|
108
109
|
|
109
110
|
describe "Configurability support", :if => defined?( Configurability ) do
|
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.
|
4
|
+
version: 0.20.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,11 +36,11 @@ cert_chain:
|
|
36
36
|
YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
|
37
37
|
Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
|
38
38
|
cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
39
|
-
date: 2012-
|
39
|
+
date: 2012-04-06 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
|
-
requirement: &
|
43
|
+
requirement: &70237984767300 !ruby/object:Gem::Requirement
|
44
44
|
none: false
|
45
45
|
requirements:
|
46
46
|
- - ~>
|
@@ -48,21 +48,21 @@ dependencies:
|
|
48
48
|
version: '1.5'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
|
-
version_requirements: *
|
51
|
+
version_requirements: *70237984767300
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
53
|
name: sequel
|
54
|
-
requirement: &
|
54
|
+
requirement: &70237984766360 !ruby/object:Gem::Requirement
|
55
55
|
none: false
|
56
56
|
requirements:
|
57
57
|
- - ~>
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '3.
|
59
|
+
version: '3.34'
|
60
60
|
type: :runtime
|
61
61
|
prerelease: false
|
62
|
-
version_requirements: *
|
62
|
+
version_requirements: *70237984766360
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: amalgalite
|
65
|
-
requirement: &
|
65
|
+
requirement: &70237984765540 !ruby/object:Gem::Requirement
|
66
66
|
none: false
|
67
67
|
requirements:
|
68
68
|
- - ~>
|
@@ -70,10 +70,10 @@ dependencies:
|
|
70
70
|
version: '1.1'
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
|
-
version_requirements: *
|
73
|
+
version_requirements: *70237984765540
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
75
|
name: tnetstring
|
76
|
-
requirement: &
|
76
|
+
requirement: &70237984764780 !ruby/object:Gem::Requirement
|
77
77
|
none: false
|
78
78
|
requirements:
|
79
79
|
- - ~>
|
@@ -81,10 +81,10 @@ dependencies:
|
|
81
81
|
version: '0.3'
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
|
-
version_requirements: *
|
84
|
+
version_requirements: *70237984764780
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: yajl-ruby
|
87
|
-
requirement: &
|
87
|
+
requirement: &70237984780340 !ruby/object:Gem::Requirement
|
88
88
|
none: false
|
89
89
|
requirements:
|
90
90
|
- - ~>
|
@@ -92,10 +92,10 @@ dependencies:
|
|
92
92
|
version: '1.0'
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
|
-
version_requirements: *
|
95
|
+
version_requirements: *70237984780340
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: trollop
|
98
|
-
requirement: &
|
98
|
+
requirement: &70237984779460 !ruby/object:Gem::Requirement
|
99
99
|
none: false
|
100
100
|
requirements:
|
101
101
|
- - ~>
|
@@ -103,10 +103,10 @@ dependencies:
|
|
103
103
|
version: '1.16'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
|
-
version_requirements: *
|
106
|
+
version_requirements: *70237984779460
|
107
107
|
- !ruby/object:Gem::Dependency
|
108
108
|
name: sysexits
|
109
|
-
requirement: &
|
109
|
+
requirement: &70237984778420 !ruby/object:Gem::Requirement
|
110
110
|
none: false
|
111
111
|
requirements:
|
112
112
|
- - ~>
|
@@ -114,10 +114,10 @@ dependencies:
|
|
114
114
|
version: '1.0'
|
115
115
|
type: :runtime
|
116
116
|
prerelease: false
|
117
|
-
version_requirements: *
|
117
|
+
version_requirements: *70237984778420
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: zmq
|
120
|
-
requirement: &
|
120
|
+
requirement: &70237984777480 !ruby/object:Gem::Requirement
|
121
121
|
none: false
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
@@ -125,21 +125,21 @@ dependencies:
|
|
125
125
|
version: 2.1.4
|
126
126
|
type: :runtime
|
127
127
|
prerelease: false
|
128
|
-
version_requirements: *
|
128
|
+
version_requirements: *70237984777480
|
129
129
|
- !ruby/object:Gem::Dependency
|
130
130
|
name: hoe-mercurial
|
131
|
-
requirement: &
|
131
|
+
requirement: &70237984776400 !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|
134
134
|
- - ~>
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 1.
|
136
|
+
version: 1.4.0
|
137
137
|
type: :development
|
138
138
|
prerelease: false
|
139
|
-
version_requirements: *
|
139
|
+
version_requirements: *70237984776400
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: hoe-highline
|
142
|
-
requirement: &
|
142
|
+
requirement: &70237984775700 !ruby/object:Gem::Requirement
|
143
143
|
none: false
|
144
144
|
requirements:
|
145
145
|
- - ~>
|
@@ -147,62 +147,62 @@ dependencies:
|
|
147
147
|
version: 0.0.1
|
148
148
|
type: :development
|
149
149
|
prerelease: false
|
150
|
-
version_requirements: *
|
150
|
+
version_requirements: *70237984775700
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
|
-
name:
|
153
|
-
requirement: &
|
152
|
+
name: rdoc
|
153
|
+
requirement: &70237984774680 !ruby/object:Gem::Requirement
|
154
154
|
none: false
|
155
155
|
requirements:
|
156
156
|
- - ~>
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
158
|
+
version: '3.10'
|
159
159
|
type: :development
|
160
160
|
prerelease: false
|
161
|
-
version_requirements: *
|
161
|
+
version_requirements: *70237984774680
|
162
162
|
- !ruby/object:Gem::Dependency
|
163
|
-
name:
|
164
|
-
requirement: &
|
163
|
+
name: configurability
|
164
|
+
requirement: &70237984773560 !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
166
|
requirements:
|
167
167
|
- - ~>
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version: '0
|
169
|
+
version: '1.0'
|
170
170
|
type: :development
|
171
171
|
prerelease: false
|
172
|
-
version_requirements: *
|
172
|
+
version_requirements: *70237984773560
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
|
-
name:
|
175
|
-
requirement: &
|
174
|
+
name: simplecov
|
175
|
+
requirement: &70237984772600 !ruby/object:Gem::Requirement
|
176
176
|
none: false
|
177
177
|
requirements:
|
178
178
|
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
180
|
+
version: '0.6'
|
181
181
|
type: :development
|
182
182
|
prerelease: false
|
183
|
-
version_requirements: *
|
183
|
+
version_requirements: *70237984772600
|
184
184
|
- !ruby/object:Gem::Dependency
|
185
|
-
name:
|
186
|
-
requirement: &
|
185
|
+
name: hoe-deveiate
|
186
|
+
requirement: &70237984787820 !ruby/object:Gem::Requirement
|
187
187
|
none: false
|
188
188
|
requirements:
|
189
189
|
- - ~>
|
190
190
|
- !ruby/object:Gem::Version
|
191
|
-
version: '
|
191
|
+
version: '0.1'
|
192
192
|
type: :development
|
193
193
|
prerelease: false
|
194
|
-
version_requirements: *
|
194
|
+
version_requirements: *70237984787820
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: hoe
|
197
|
-
requirement: &
|
197
|
+
requirement: &70237984786680 !ruby/object:Gem::Requirement
|
198
198
|
none: false
|
199
199
|
requirements:
|
200
200
|
- - ~>
|
201
201
|
- !ruby/object:Gem::Version
|
202
|
-
version: '
|
202
|
+
version: '3.0'
|
203
203
|
type: :development
|
204
204
|
prerelease: false
|
205
|
-
version_requirements: *
|
205
|
+
version_requirements: *70237984786680
|
206
206
|
description: ! 'Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for
|
207
207
|
|
208
208
|
Mongrel2[http://mongrel2.org/].
|
@@ -221,11 +221,11 @@ executables:
|
|
221
221
|
- m2sh.rb
|
222
222
|
extensions: []
|
223
223
|
extra_rdoc_files:
|
224
|
-
- Manifest.txt
|
225
|
-
- examples/README.txt
|
226
224
|
- DSL.rdoc
|
227
225
|
- History.rdoc
|
226
|
+
- Manifest.txt
|
228
227
|
- README.rdoc
|
228
|
+
- examples/README.txt
|
229
229
|
files:
|
230
230
|
- .autotest
|
231
231
|
- .gemtest
|
metadata.gz.sig
CHANGED
Binary file
|