mongrel2 0.22.1 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,8 +1,20 @@
1
1
  2012-05-07 Michael Granger <ged@FaerieMUD.org>
2
2
 
3
+ * .hgtags:
4
+ Added tag v0.22.1 for changeset ab969af3bf2c
5
+ [142eade04d61] [tip]
6
+
7
+ * .hgsigs:
8
+ Added signature for changeset c68ca662121f
9
+ [ab969af3bf2c] [v0.22.1]
10
+
11
+ * .rvm.gems, History.rdoc, Rakefile, lib/mongrel2.rb:
12
+ Fix loggability dependency version; bump patch version.
13
+ [c68ca662121f]
14
+
3
15
  * .hgtags:
4
16
  Added tag v0.22.0 for changeset 82e0a3ed6dc5
5
- [666e8d88a6d7] [tip]
17
+ [666e8d88a6d7]
6
18
 
7
19
  * .hgsigs:
8
20
  Added signature for changeset e25ffaab1897
@@ -28,13 +40,13 @@
28
40
  spec/mongrel2/logging_spec.rb, spec/mongrel2/mixins_spec.rb,
29
41
  spec/mongrel2_spec.rb:
30
42
  Convert to Loggability for logging.
31
- [0da53476f796]
43
+ [0da53476f796] [github/master]
32
44
 
33
45
  2012-04-25 Michael Granger <ged@FaerieMUD.org>
34
46
 
35
47
  * bin/m2sh.rb:
36
48
  Add an option to m2sh.rb to set the m2 port on the fly
37
- [0a0238b4c238] [github/master]
49
+ [0a0238b4c238]
38
50
 
39
51
  2012-04-23 Michael Granger <ged@FaerieMUD.org>
40
52
 
data/History.rdoc CHANGED
@@ -1,3 +1,11 @@
1
+ == v0.23.0 [2012-05-17] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Add a convenience method to Mongrel2::Handler for fetching its
4
+ associated config object.
5
+ - Fix typos in m2sh.rb's exception handler
6
+ - Bumping dependency on Loggability to 0.2.
7
+
8
+
1
9
  == v0.22.1 [2012-05-07] Michael Granger <ged@FaerieMUD.org>
2
10
 
3
11
  Fix loggability dependency version.
data/Rakefile CHANGED
@@ -22,7 +22,6 @@ hoespec = Hoe.spec 'mongrel2' do
22
22
  self.readme_file = 'README.rdoc'
23
23
  self.history_file = 'History.rdoc'
24
24
  self.extra_rdoc_files = Rake::FileList[ '*.rdoc' ]
25
- self.spec_extras[:rdoc_options] = ['-t', 'Ruby-Mongrel2']
26
25
 
27
26
  self.developer 'Michael Granger', 'ged@FaerieMUD.org'
28
27
 
@@ -34,7 +33,7 @@ hoespec = Hoe.spec 'mongrel2' do
34
33
  self.dependency 'trollop', '~> 1.16'
35
34
  self.dependency 'sysexits', '~> 1.0'
36
35
  self.dependency 'zmq', '~> 2.1'
37
- self.dependency 'loggability','~> 0.0'
36
+ self.dependency 'loggability','~> 0.2'
38
37
 
39
38
  self.dependency 'configurability', '~> 1.0', :developer
40
39
  self.dependency 'simplecov', '~> 0.6', :developer
data/bin/m2sh.rb CHANGED
@@ -130,8 +130,8 @@ class Mongrel2::M2SHCommand
130
130
  exit :ok
131
131
 
132
132
  rescue => err
133
- self.fatal "Oops: %s: %s" % [ err.class.name, err.message ]
134
- self.debug { ' ' + err.backtrace.join("\n ") }
133
+ self.log.fatal "Oops: %s: %s" % [ err.class.name, err.message ]
134
+ self.log.debug { ' ' + err.backtrace.join("\n ") }
135
135
 
136
136
  exit :software_error
137
137
  end
@@ -121,7 +121,7 @@ class Mongrel2::Connection
121
121
  ### Write raw +data+ to the given connection ID (+conn_id+) at the given +sender_id+.
122
122
  def send( sender_id, conn_id, data )
123
123
  self.check_closed
124
- header = "%s %d:%s," % [ sender_id, conn_id.to_s.length, conn_id ]
124
+ header = "%s %d:%s," % [ sender_id, conn_id.to_s.length, conn_id ]
125
125
  buf = header + ' ' + data
126
126
  self.log.debug "Sending response (PUB): %p" % [ buf ]
127
127
  self.response_sock.send( buf )
@@ -119,7 +119,8 @@ class Mongrel2::Handler
119
119
  ### Create a new instance of the handler with the specified +app_id+, +send_spec+,
120
120
  ### and +recv_spec+.
121
121
  def initialize( app_id, send_spec, recv_spec ) # :notnew:
122
- @conn = Mongrel2::Connection.new( app_id, send_spec, recv_spec )
122
+ @app_id = app_id
123
+ @conn = Mongrel2::Connection.new( app_id, send_spec, recv_spec )
123
124
  end
124
125
 
125
126
 
@@ -130,6 +131,9 @@ class Mongrel2::Handler
130
131
  # The handler's Mongrel2::Connection object.
131
132
  attr_reader :conn
132
133
 
134
+ # The app ID the app was created with
135
+ attr_reader :app_id
136
+
133
137
 
134
138
  ### Run the handler.
135
139
  def run
@@ -144,6 +148,13 @@ class Mongrel2::Handler
144
148
  end
145
149
 
146
150
 
151
+ ### Return the Mongrel2::Config::Handler that corresponds to this app's
152
+ ### appid.
153
+ def handler_config
154
+ return Mongrel2::Config::Handler.by_send_ident( self.app_id ).first
155
+ end
156
+
157
+
147
158
  ### Shut down the handler.
148
159
  def shutdown
149
160
  self.log.info "Shutting down."
data/lib/mongrel2.rb CHANGED
@@ -20,10 +20,10 @@ module Mongrel2
20
20
  abort "\n\n>>> Mongrel2 requires Ruby 1.9.2 or later. <<<\n\n" if RUBY_VERSION < '1.9.2'
21
21
 
22
22
  # Library version constant
23
- VERSION = '0.22.1'
23
+ VERSION = '0.23.0'
24
24
 
25
25
  # Version-control revision constant
26
- REVISION = %q$Revision: c68ca662121f $
26
+ REVISION = %q$Revision: 7d768d6e98ab $
27
27
 
28
28
 
29
29
  require 'mongrel2/constants'
@@ -106,6 +106,17 @@ describe Mongrel2::Handler do
106
106
  res.conn.pub_addr.should == TEST_RECV_SPEC
107
107
  end
108
108
 
109
+ it "knows what handler config corresponds to its" do
110
+ req = make_request()
111
+ @request_sock.should_receive( :recv ).and_return( req )
112
+
113
+ res = OneShotHandler.run( TEST_UUID )
114
+
115
+ res.handler_config.should be_a( Mongrel2::Config::Handler )
116
+ res.handler_config.send_spec.should == TEST_SEND_SPEC
117
+ res.handler_config.recv_spec.should == TEST_RECV_SPEC
118
+ end
119
+
109
120
  end
110
121
 
111
122
 
data.tar.gz.sig CHANGED
Binary file
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.22.1
4
+ version: 0.23.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
37
37
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
38
38
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2012-05-07 00:00:00.000000000 Z
39
+ date: 2012-05-17 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
@@ -173,7 +173,7 @@ dependencies:
173
173
  requirements:
174
174
  - - ~>
175
175
  - !ruby/object:Gem::Version
176
- version: '0.0'
176
+ version: '0.2'
177
177
  type: :runtime
178
178
  prerelease: false
179
179
  version_requirements: !ruby/object:Gem::Requirement
@@ -181,7 +181,7 @@ dependencies:
181
181
  requirements:
182
182
  - - ~>
183
183
  - !ruby/object:Gem::Version
184
- version: '0.0'
184
+ version: '0.2'
185
185
  - !ruby/object:Gem::Dependency
186
186
  name: hoe-mercurial
187
187
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file