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 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] [tip]
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] [github/master]
129
+ [0db6f3808f5a]
118
130
 
119
131
  2012-03-02 Michael Granger <ged@FaerieMUD.org>
120
132
 
@@ -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.31'
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 'rspec', '~> 2.8', :developer
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' )
@@ -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.19.0'
17
+ VERSION = '0.20.1'
18
18
 
19
19
  # Version-control revision constant
20
- REVISION = %q$Revision: a0a3115eb782 $
20
+ REVISION = %q$Revision: 55a458211cb9 $
21
21
 
22
22
 
23
23
  require 'mongrel2/logging'
@@ -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 a bound Method object to the Sequel constructor of choice for the
89
- ### config DB. This is used to choose either 'amalgalite' or 'sqlite3', preferring
90
- ### the former.
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 Sequel.method( :amalgalite )
92
+ return 'amalgalite'
94
93
  else
95
- return Sequel.method( :sqlite )
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
- # Just calling either .amalgalite or .sqlite returns an in-memory DB
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 = self.adapter_method.call( config[:configdb] )
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 a Pathname object for the current database, or nil if the current
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::pathname
203
- dburi = URI( self.db.uri )
204
- pathname = dburi.path
205
- pathname.slice!( 0, 1 ) if pathname.start_with?( '/' )
206
- return nil if pathname.empty?
207
- return Pathname( pathname )
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
 
@@ -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( dbspec=':memory:' )
121
- Mongrel2::Config.configure( :configdb => dbspec ) unless
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
@@ -26,8 +26,7 @@ describe Mongrel2::Config::Route do
26
26
 
27
27
  before( :all ) do
28
28
  setup_logging()
29
- Mongrel2::Config.configure( :configdb => ':memory:' )
30
- Mongrel2::Config.init_database
29
+ setup_config_db()
31
30
  end
32
31
 
33
32
  before( :each ) do
@@ -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 = Mongrel2::Config.adapter_method[ 'config-spec.sqlite' ]
101
- Mongrel2::Config.pathname.should == Pathname( 'config-spec.sqlite' )
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.pathname.should be_nil()
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.19.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-03-28 00:00:00.000000000 Z
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: &70214632899820 !ruby/object:Gem::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: *70214632899820
51
+ version_requirements: *70237984767300
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: sequel
54
- requirement: &70214632897680 !ruby/object:Gem::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.31'
59
+ version: '3.34'
60
60
  type: :runtime
61
61
  prerelease: false
62
- version_requirements: *70214632897680
62
+ version_requirements: *70237984766360
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: amalgalite
65
- requirement: &70214632896600 !ruby/object:Gem::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: *70214632896600
73
+ version_requirements: *70237984765540
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: tnetstring
76
- requirement: &70214632895520 !ruby/object:Gem::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: *70214632895520
84
+ version_requirements: *70237984764780
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: yajl-ruby
87
- requirement: &70214625392560 !ruby/object:Gem::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: *70214625392560
95
+ version_requirements: *70237984780340
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: trollop
98
- requirement: &70214625390540 !ruby/object:Gem::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: *70214625390540
106
+ version_requirements: *70237984779460
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: sysexits
109
- requirement: &70214625388540 !ruby/object:Gem::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: *70214625388540
117
+ version_requirements: *70237984778420
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: zmq
120
- requirement: &70214625385800 !ruby/object:Gem::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: *70214625385800
128
+ version_requirements: *70237984777480
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: hoe-mercurial
131
- requirement: &70214625406480 !ruby/object:Gem::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.3.1
136
+ version: 1.4.0
137
137
  type: :development
138
138
  prerelease: false
139
- version_requirements: *70214625406480
139
+ version_requirements: *70237984776400
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: hoe-highline
142
- requirement: &70214625403620 !ruby/object:Gem::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: *70214625403620
150
+ version_requirements: *70237984775700
151
151
  - !ruby/object:Gem::Dependency
152
- name: configurability
153
- requirement: &70214625401920 !ruby/object:Gem::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: '1.0'
158
+ version: '3.10'
159
159
  type: :development
160
160
  prerelease: false
161
- version_requirements: *70214625401920
161
+ version_requirements: *70237984774680
162
162
  - !ruby/object:Gem::Dependency
163
- name: simplecov
164
- requirement: &70214625399640 !ruby/object:Gem::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.6'
169
+ version: '1.0'
170
170
  type: :development
171
171
  prerelease: false
172
- version_requirements: *70214625399640
172
+ version_requirements: *70237984773560
173
173
  - !ruby/object:Gem::Dependency
174
- name: rspec
175
- requirement: &70214625418940 !ruby/object:Gem::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: '2.8'
180
+ version: '0.6'
181
181
  type: :development
182
182
  prerelease: false
183
- version_requirements: *70214625418940
183
+ version_requirements: *70237984772600
184
184
  - !ruby/object:Gem::Dependency
185
- name: rdoc
186
- requirement: &70214625418020 !ruby/object:Gem::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: '3.10'
191
+ version: '0.1'
192
192
  type: :development
193
193
  prerelease: false
194
- version_requirements: *70214625418020
194
+ version_requirements: *70237984787820
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: hoe
197
- requirement: &70214625417200 !ruby/object:Gem::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: '2.13'
202
+ version: '3.0'
203
203
  type: :development
204
204
  prerelease: false
205
- version_requirements: *70214625417200
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