mongrel2 0.15.0 → 0.15.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,8 +1,53 @@
1
+ 2012-03-01 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * lib/mongrel2/connection.rb:
4
+ Fix some comments/debug statements in Connection
5
+ [16a888bc7999] [github/master, tip]
6
+
7
+ * lib/mongrel2/config/host.rb:
8
+ Make sure host deletes cascade to their routes
9
+ [b0f642f12cec]
10
+
11
+ * lib/mongrel2/config/dsl.rb:
12
+ Init the database outside of the transaction in the "server" DSL
13
+ method
14
+ [9ebc726b8fd1]
15
+
16
+ * examples/request-dumper.rb:
17
+ Remove the SAFE test from the request-dumper example
18
+ [e7fe8c9f32a5]
19
+
20
+ * bin/m2sh.rb:
21
+ Correct the line number of errors in configs loaded from m2sh.rb
22
+ [7c22054835a0]
23
+
24
+ * lib/mongrel2/config.rb:
25
+ Log SQL to the logger at DEBUG level
26
+ [06fa58a7eb4a]
27
+
1
28
  2012-02-27 Michael Granger <ged@FaerieMUD.org>
2
29
 
30
+ * .hgtags:
31
+ Added tag v0.15.0 for changeset ed540a27e271
32
+ [dc3dafb80ae0]
33
+
34
+ * .hgsigs:
35
+ Added signature for changeset 43a5d2cb1865
36
+ [ed540a27e271] [v0.15.0]
37
+
38
+ * History.rdoc, lib/mongrel2.rb:
39
+ Bump the minor version, update history.
40
+ [43a5d2cb1865]
41
+
42
+ * lib/mongrel2/config/server.rb:
43
+ Fix the Mongrel2::Config::Server.by_uuid dataset method
44
+
45
+ Return a dataset instead of the instance.
46
+ [59a7fc6abae2]
47
+
3
48
  * .hgtags:
4
49
  Added tag v0.14.0 for changeset 5a2a21415dff
5
- [aa9c635b978f] [tip]
50
+ [aa9c635b978f]
6
51
 
7
52
  * .hgsigs:
8
53
  Added signature for changeset e50e20d73e34
@@ -61,7 +106,7 @@
61
106
  - Don't set a Content-type header
62
107
  - Omit the body even if there is one
63
108
  - Set the content-length to 0
64
- [cdb39968287a] [github/master]
109
+ [cdb39968287a]
65
110
 
66
111
  2012-02-17 Michael Granger <ged@FaerieMUD.org>
67
112
 
@@ -1,3 +1,13 @@
1
+ == v0.15.1 [2012-03-02] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Make sure Mongrel2::Config::Host deletes cascade to their routes
4
+ - Init the database outside of the transaction in the "server" DSL
5
+ method
6
+ - Remove the SAFE test from the request-dumper example
7
+ - Correct the line number of errors in configs loaded from m2sh.rb
8
+ - Log SQL to the logger at DEBUG level
9
+
10
+
1
11
  == v0.15.0 [2012-02-27] Michael Granger <ged@FaerieMUD.org>
2
12
 
3
13
  - Fix the Mongrel2::Config::Server.by_uuid dataset method to return a
@@ -294,7 +294,7 @@ class Mongrel2::M2SHCommand
294
294
  header "Loading config from #{configfile}"
295
295
  source = File.read( configfile )
296
296
 
297
- runspace.module_eval( source, configfile, 0 )
297
+ runspace.module_eval( source, configfile, 1 )
298
298
  end
299
299
  help :load, "Overwrite the config database with the values from the speciifed CONFIGFILE."
300
300
  usage :load, <<-END_USAGE
@@ -22,28 +22,23 @@ class RequestDumper < Mongrel2::Handler
22
22
 
23
23
  ### Handle a request
24
24
  def handle( request )
25
- Thread.new do
26
- Thread.current.abort_on_exception = true
27
- $SAFE = 1
25
+ template = @template.dup
26
+ response = request.response
28
27
 
29
- template = @template.dup
30
- response = request.response
28
+ template.request = request
29
+ template.title = "Ruby-Mongrel2 Request Dumper"
30
+ template.safelevel = $SAFE
31
31
 
32
- template.request = request
33
- template.title = "Ruby-Mongrel2 Request Dumper"
34
- template.safelevel = $SAFE
32
+ response.status = 200
33
+ response.headers.content_type = 'text/html'
34
+ response.puts( template )
35
35
 
36
- response.status = 200
37
- response.headers.content_type = 'text/html'
38
- response.puts( template )
39
-
40
- response
41
- end.value
36
+ response
42
37
  end
43
38
 
44
39
  end # class RequestDumper
45
40
 
46
- Mongrel2.log.level = $DEBUG ? Logger::DEBUG : Logger::INFO
41
+ Mongrel2.log.level = Logger::DEBUG
47
42
  Inversion.log.level = Logger::INFO
48
43
 
49
44
  # Point to the config database, which will cause the handler to use
@@ -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.15.0'
17
+ VERSION = '0.15.1'
18
18
 
19
19
  # Version-control revision constant
20
- REVISION = %q$Revision: 43a5d2cb1865 $
20
+ REVISION = %q$Revision: e943c9068b73 $
21
21
 
22
22
 
23
23
  require 'mongrel2/logging'
@@ -124,6 +124,9 @@ module Mongrel2
124
124
  if self == Mongrel2::Config
125
125
  Mongrel2.log.debug "Resetting database connection for %d config classes to: %p" %
126
126
  [ self.descendents.length, newdb ]
127
+ newdb.logger = Mongrel2.logger
128
+ newdb.sql_log_level = :debug
129
+
127
130
  self.descendents.each {|subclass| subclass.db = newdb }
128
131
  end
129
132
  end
@@ -86,10 +86,11 @@ module Mongrel2::Config::DSL
86
86
  def server( uuid, &block )
87
87
  adapter = nil
88
88
 
89
+ Mongrel2.log.info "Ensuring db is set up..."
90
+ Mongrel2::Config.init_database
91
+
89
92
  Mongrel2.log.info "Entering transaction for server %p" % [ uuid ]
90
93
  Mongrel2::Config.db.transaction do
91
- Mongrel2.log.info " ensuring db is set up..."
92
- Mongrel2::Config.init_database
93
94
 
94
95
  # Set up the options hash with the UUID and reasonable defaults
95
96
  # for everything else
@@ -16,6 +16,13 @@ class Mongrel2::Config::Host < Mongrel2::Config( :host )
16
16
  one_to_many :routes
17
17
  many_to_one :server
18
18
 
19
+
20
+ ### Clean up the host's routes when it's destroyed.
21
+ def before_destroy
22
+ self.routes.each( &:destroy )
23
+ end
24
+
25
+
19
26
  ### DSL methods for the Server context besides those automatically-generated from its
20
27
  ### columns.
21
28
  module DSLMethods
@@ -110,11 +110,12 @@ class Mongrel2::Connection
110
110
  ### Fetch the next request from the server as a Mongrel2::Request object.
111
111
  def receive
112
112
  raw_req = self.recv
113
+ self.log.debug "Receive: parsing raw request: %d bytes" % [ raw_req.bytesize ]
113
114
  return Mongrel2::Request.parse( raw_req )
114
115
  end
115
116
 
116
117
 
117
- ### Write a raw +data+ to the given connection ID (+conn_id+) at the given +sender_id+.
118
+ ### Write raw +data+ to the given connection ID (+conn_id+) at the given +sender_id+.
118
119
  def send( sender_id, conn_id, data )
119
120
  self.check_closed
120
121
  header = "%s %d:%s," % [ sender_id, conn_id.to_s.length, conn_id ]
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.15.0
4
+ version: 0.15.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-02-27 00:00:00.000000000 Z
39
+ date: 2012-03-02 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
- requirement: &70183892949060 !ruby/object:Gem::Requirement
43
+ requirement: &70344063433420 !ruby/object:Gem::Requirement
44
44
  none: false
45
45
  requirements:
46
46
  - - ~>
@@ -48,10 +48,10 @@ dependencies:
48
48
  version: '1.5'
49
49
  type: :runtime
50
50
  prerelease: false
51
- version_requirements: *70183892949060
51
+ version_requirements: *70344063433420
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: sequel
54
- requirement: &70183892948300 !ruby/object:Gem::Requirement
54
+ requirement: &70344063432920 !ruby/object:Gem::Requirement
55
55
  none: false
56
56
  requirements:
57
57
  - - ~>
@@ -59,10 +59,10 @@ dependencies:
59
59
  version: '3.31'
60
60
  type: :runtime
61
61
  prerelease: false
62
- version_requirements: *70183892948300
62
+ version_requirements: *70344063432920
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: amalgalite
65
- requirement: &70183892947260 !ruby/object:Gem::Requirement
65
+ requirement: &70344063448860 !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: *70183892947260
73
+ version_requirements: *70344063448860
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: tnetstring
76
- requirement: &70183892946540 !ruby/object:Gem::Requirement
76
+ requirement: &70344063448440 !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: *70183892946540
84
+ version_requirements: *70344063448440
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: yajl-ruby
87
- requirement: &70183892945340 !ruby/object:Gem::Requirement
87
+ requirement: &70344063448020 !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: *70183892945340
95
+ version_requirements: *70344063448020
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: trollop
98
- requirement: &70183897140160 !ruby/object:Gem::Requirement
98
+ requirement: &70344063447600 !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: *70183897140160
106
+ version_requirements: *70344063447600
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: sysexits
109
- requirement: &70183897139300 !ruby/object:Gem::Requirement
109
+ requirement: &70344063447180 !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: *70183897139300
117
+ version_requirements: *70344063447180
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: zmq
120
- requirement: &70183897137840 !ruby/object:Gem::Requirement
120
+ requirement: &70344063446760 !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
123
123
  - - ~>
@@ -125,10 +125,10 @@ dependencies:
125
125
  version: 2.1.4
126
126
  type: :runtime
127
127
  prerelease: false
128
- version_requirements: *70183897137840
128
+ version_requirements: *70344063446760
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: hoe-mercurial
131
- requirement: &70183897136860 !ruby/object:Gem::Requirement
131
+ requirement: &70344063446340 !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements:
134
134
  - - ~>
@@ -136,10 +136,10 @@ dependencies:
136
136
  version: 1.3.1
137
137
  type: :development
138
138
  prerelease: false
139
- version_requirements: *70183897136860
139
+ version_requirements: *70344063446340
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: hoe-highline
142
- requirement: &70183897136040 !ruby/object:Gem::Requirement
142
+ requirement: &70344063445860 !ruby/object:Gem::Requirement
143
143
  none: false
144
144
  requirements:
145
145
  - - ~>
@@ -147,10 +147,10 @@ dependencies:
147
147
  version: 0.0.1
148
148
  type: :development
149
149
  prerelease: false
150
- version_requirements: *70183897136040
150
+ version_requirements: *70344063445860
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: configurability
153
- requirement: &70183897135140 !ruby/object:Gem::Requirement
153
+ requirement: &70344063445400 !ruby/object:Gem::Requirement
154
154
  none: false
155
155
  requirements:
156
156
  - - ~>
@@ -158,10 +158,10 @@ dependencies:
158
158
  version: '1.0'
159
159
  type: :development
160
160
  prerelease: false
161
- version_requirements: *70183897135140
161
+ version_requirements: *70344063445400
162
162
  - !ruby/object:Gem::Dependency
163
163
  name: rspec
164
- requirement: &70183897134280 !ruby/object:Gem::Requirement
164
+ requirement: &70344063444980 !ruby/object:Gem::Requirement
165
165
  none: false
166
166
  requirements:
167
167
  - - ~>
@@ -169,10 +169,10 @@ dependencies:
169
169
  version: '2.8'
170
170
  type: :development
171
171
  prerelease: false
172
- version_requirements: *70183897134280
172
+ version_requirements: *70344063444980
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: rdoc
175
- requirement: &70183897133440 !ruby/object:Gem::Requirement
175
+ requirement: &70344063444560 !ruby/object:Gem::Requirement
176
176
  none: false
177
177
  requirements:
178
178
  - - ~>
@@ -180,10 +180,10 @@ dependencies:
180
180
  version: '3.10'
181
181
  type: :development
182
182
  prerelease: false
183
- version_requirements: *70183897133440
183
+ version_requirements: *70344063444560
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: hoe
186
- requirement: &70183897156460 !ruby/object:Gem::Requirement
186
+ requirement: &70344063444080 !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
189
189
  - - ~>
@@ -191,7 +191,7 @@ dependencies:
191
191
  version: '2.13'
192
192
  type: :development
193
193
  prerelease: false
194
- version_requirements: *70183897156460
194
+ version_requirements: *70344063444080
195
195
  description: ! "Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for \nMongrel2[http://mongrel2.org/].\n\nThis
196
196
  library includes configuration-database ORM classes, a Ruby\nimplementation of the
197
197
  'm2sh' tool, a configuration DSL for generating config\ndatabases in pure Ruby,
metadata.gz.sig CHANGED
Binary file