mongrel2 0.30.1 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,8 +1,137 @@
1
+ 2012-07-27 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * .hgtags:
4
+ Added tag v0.30.1 for changeset 01750f74082c
5
+ [8208fbbc6641] [tip]
6
+
7
+ * .hgsigs:
8
+ Added signature for changeset 4ebef57dc78c
9
+ [01750f74082c] [v0.30.1]
10
+
11
+ * History.rdoc, lib/mongrel2.rb:
12
+ Bump the patch version, update history.
13
+ [4ebef57dc78c]
14
+
15
+ * Rakefile:
16
+ Depend on sqlite3 instead of amalgalite until
17
+ (https://github.com/copiousfreetime/amalgalite/pull/22) is fixed.
18
+ [9244ea0f0a1c]
19
+
20
+ * README.rdoc:
21
+ Fixing URLs
22
+ [6d4a90ec1980]
23
+
24
+ * .hgtags:
25
+ Added tag v0.30.0 for changeset 2a049832e502
26
+ [3ba5c68433bf]
27
+
28
+ * .hgsigs:
29
+ Added signature for changeset 560f4524ebb0
30
+ [2a049832e502] [v0.30.0]
31
+
32
+ * History.rdoc, lib/mongrel2.rb:
33
+ Bump minor version, update history.
34
+ [560f4524ebb0]
35
+
36
+ * Manifest.txt, Rakefile, bin/m2sh.rb, data/mongrel2/index.html.in:
37
+ Add some quickstart niceties.
38
+
39
+ - Add a static index page to the quickstart Dir directory.
40
+ - Make the failure to find a mongrel2 binary friendlier.
41
+ [b1d49912af4d]
42
+
43
+ 2012-07-18 Michael Granger <ged@FaerieMUD.org>
44
+
45
+ * lib/mongrel2/config/handler.rb:
46
+ Fix parameter name of ::by_send_ident for auto-mapping by the rest
47
+ service.
48
+ [b24be0f1aa72]
49
+
50
+ 2012-07-13 Michael Granger <ged@FaerieMUD.org>
51
+
52
+ * .hgtags:
53
+ Added tag v0.29.0 for changeset b8cf89311fb4
54
+ [667c5c23df4e]
55
+
56
+ * .hgsigs:
57
+ Added signature for changeset cc6fcfdf3335
58
+ [b8cf89311fb4] [v0.29.0]
59
+
60
+ * History.rdoc, lib/mongrel2.rb:
61
+ Bump the minor version, update history.
62
+ [cc6fcfdf3335]
63
+
64
+ * bin/m2sh.rb, lib/mongrel2/config.rb, lib/mongrel2/config/log.rb,
65
+ lib/mongrel2/config/server.rb, spec/mongrel2/config/log_spec.rb:
66
+ Finish work on the event log.
67
+ - Make m2sh.rb write events for modifying actions
68
+ - Add a --why option to m2sh.rb to allow reasons for actions to be
69
+ logged.
70
+ - Add a convenience delegator to Mongrel2::Config for logging an
71
+ action.
72
+ - Finish Mongrel2::Config::Log method documentation
73
+ - Remove RDoc sections from Mongrel2::Config::Server, as they made
74
+ stuff more difficult to find.
75
+ - Add Mongrel2::Config::Server#to_s
76
+ - Make stringified Log events only include parens if the event has a
77
+ 'why' field.
78
+ [be803763277b]
79
+
80
+ 2012-07-12 Michael Granger <ged@FaerieMUD.org>
81
+
82
+ * bin/m2sh.rb:
83
+ Remove extraneous message from m2sh.rb's quickstart subcommand
84
+ [f61d11f41fd5]
85
+
86
+ * .hgtags:
87
+ Added tag v0.28.0 for changeset 87ce465f7115
88
+ [fbe30eb8facb]
89
+
90
+ * .hgsigs:
91
+ Added signature for changeset 511f5e29f0a0
92
+ [87ce465f7115] [v0.28.0]
93
+
94
+ * History.rdoc, lib/mongrel2.rb:
95
+ Bump the minor version, update history.
96
+ [511f5e29f0a0]
97
+
98
+ * lib/mongrel2/config/server.rb, spec/mongrel2/config/dsl_spec.rb,
99
+ spec/mongrel2/config/server_spec.rb:
100
+ Make Config::Server path methods variants instead of overrides.
101
+ [348e208d3fc8]
102
+
103
+ * lib/mongrel2/config/server.rb, spec/mongrel2/config/dsl_spec.rb,
104
+ spec/mongrel2/config/server_spec.rb:
105
+ Return Pathname objects from Mongrel2::Config::Server's path
106
+ attributes.
107
+ [eacf9ac21a43]
108
+
109
+ 2012-07-11 Michael Granger <ged@FaerieMUD.org>
110
+
111
+ * bin/m2sh.rb:
112
+ Show the server's URL at startup
113
+ [2d666bba472c]
114
+
115
+ * lib/mongrel2/config/server.rb:
116
+ Finish Config::Server API docs and add a predicate method for
117
+ use_ssl
118
+ [fc283cc7a9f5]
119
+
120
+ 2012-07-03 Michael Granger <ged@FaerieMUD.org>
121
+
122
+ * bin/m2sh.rb:
123
+ Remove shell mode from m2sh.rb.
124
+ [d6c7fbd1142c]
125
+
126
+ * Manifest.txt:
127
+ Don't distribute my Foreman env for the examples
128
+ [c54940c0c1c8]
129
+
1
130
  2012-07-02 Michael Granger <ged@FaerieMUD.org>
2
131
 
3
132
  * .hgtags:
4
133
  Added tag v0.27.0 for changeset 8883019d3299
5
- [b85c576e5fb1] [tip]
134
+ [b85c576e5fb1]
6
135
 
7
136
  * .hgsigs:
8
137
  Added signature for changeset 6de3cbe2409c
data/History.rdoc CHANGED
@@ -1,3 +1,13 @@
1
+ == v0.31.0 [2012-07-30] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Improve Server control-socket pathing.
4
+
5
+ Mongrel2::Config::Server#control_socket will now check for it
6
+ under the chroot, and relative to the pwd, and will raise an
7
+ exception if no socket is found instead of just returning a
8
+ socket that's doomed to block forever.
9
+
10
+
1
11
  == v0.30.1 [2012-07-27] Michael Granger <ged@FaerieMUD.org>
2
12
 
3
13
  Documentation and packaging fixes. Switch to sqlite3 until
data/bin/m2sh.rb CHANGED
@@ -49,7 +49,7 @@ class Mongrel2::M2SHCommand
49
49
  extend ::Sysexits,
50
50
  Loggability
51
51
  include Sysexits,
52
- Mongrel2::Constants
52
+ Mongrel2::Constants
53
53
 
54
54
  # Loggability API -- set up logging under the 'strelka' log host
55
55
  log_to :mongrel2
@@ -448,6 +448,14 @@ class Mongrel2::M2SHCommand
448
448
  server.port,
449
449
  ]
450
450
 
451
+ # Change into the server's chroot directory so paths line up whether or not
452
+ # it's started as root
453
+ Dir.chdir( server.chroot ) do
454
+ Mongrel2::Config.log_action( "Starting server: #{server}", self.options.why )
455
+ header "Starting mongrel2 at: #{url}"
456
+ exec( *cmd )
457
+ end
458
+
451
459
  Mongrel2::Config.log_action( "Starting server: #{server}", self.options.why )
452
460
  message '*' * 70
453
461
  header "Starting mongrel2 at: #{url}"
data/examples/Procfile CHANGED
@@ -3,4 +3,4 @@ mongrel2: ruby ../bin/m2sh.rb -c examples.sqlite start
3
3
  helloworld: ruby helloworld-handler.rb
4
4
  async_upload: ruby async-upload.rb
5
5
  request_dumper: ruby request-dumper.rb
6
- ws: ruby -w ws-echo.rb
6
+ ws: ruby ws-echo.rb
data/examples/config.rb CHANGED
@@ -20,7 +20,7 @@ server 'examples' do
20
20
 
21
21
  access_log '/logs/access.log'
22
22
  error_log '/logs/error.log'
23
- chroot '/var/mongrel2'
23
+ chroot basedir
24
24
  pid_file '/var/run/mongrel2.pid'
25
25
 
26
26
  bind_addr '0.0.0.0'
@@ -51,6 +51,7 @@ setting 'control_port', 'ipc://var/run/control'
51
51
  setting 'upload.temp_store', upload_dir + 'mongrel2.upload.XXXXXX'
52
52
 
53
53
  mkdir_p 'var/run'
54
+ mkdir_p 'var/mongrel2'
54
55
  mkdir_p 'logs'
55
56
  mkdir_p '/tmp/mongrel2-uploads'
56
57
 
@@ -141,7 +141,14 @@ class Mongrel2::Config::Server < Mongrel2::Config( :server )
141
141
  self.log.debug " chrooted socket path is: %p" % [ sock_path ]
142
142
 
143
143
  csock_path = self.chroot_path + sock_path
144
- self.log.debug " fully-qualified path is: %p" % [ csock_path ]
144
+ if csock_path.socket?
145
+ self.log.debug " socket path is relative to the chroot: %p" % [ csock_path ]
146
+ else
147
+ csock_path = Pathname.pwd + sock_path
148
+ raise "Unable to find the socket path %p" % [ csock_uri ] unless csock_path.socket?
149
+ self.log.debug " socket path is relative to the PWD: %p" % [ csock_path ]
150
+ end
151
+
145
152
  csock_uri = "%s://%s" % [ scheme, csock_path ]
146
153
 
147
154
  self.log.debug " control socket URI is: %p" % [ csock_uri ]
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'zmq'
4
4
  require 'yajl'
5
+ require 'pathname'
5
6
  require 'tnetstring'
6
7
  require 'loggability'
7
8
 
@@ -25,6 +26,7 @@ class Mongrel2::Control
25
26
 
26
27
  ### Create a new control port object using the current configuration.
27
28
  def initialize( port=DEFAULT_PORT )
29
+ check_port( port )
28
30
  @ctx = Mongrel2.zmq_context
29
31
  @socket = @ctx.socket( ZMQ::REQ )
30
32
  @socket.setsockopt( ZMQ::LINGER, 0 )
@@ -207,6 +209,18 @@ class Mongrel2::Control
207
209
  end
208
210
  end
209
211
 
212
+
213
+ ### Check the path of the specified port if it's an 'ipc' URL, ensuring that a pipe exists
214
+ ### there, and raising an exception if none does.
215
+ def check_port( port )
216
+ scheme, path = port.split( '://' )
217
+ return unless scheme == 'ipc'
218
+
219
+ raise "%s: not a socket" % [ path ] unless FileTest.socket?( path )
220
+
221
+ return true
222
+ end
223
+
210
224
  end # class Mongrel2::Control
211
225
 
212
226
  # vim: set nosta noet ts=4 sw=4:
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.30.1'
23
+ VERSION = '0.31.0'
24
24
 
25
25
  # Version-control revision constant
26
- REVISION = %q$Revision: 4ebef57dc78c $
26
+ REVISION = %q$Revision: 11f88c736464 $
27
27
 
28
28
 
29
29
  require 'mongrel2/constants'
@@ -83,17 +83,29 @@ describe Mongrel2::Config::Server do
83
83
 
84
84
  it "knows where its control socket is if there's no setting for control_port" do
85
85
  Mongrel2::Config::Setting.dataset.truncate
86
+ FileTest.stub( :socket? ).with( '/usr/local/www/run/control' ).
87
+ and_return( true )
86
88
  @server.control_socket_uri.should == 'ipc:///usr/local/www/run/control'
87
89
  end
88
90
 
89
91
  it "knows where its control socket is if there is a setting for control_port" do
90
92
  Mongrel2::Config::Setting.dataset.truncate
93
+ FileTest.stub( :socket? ).with( '/usr/local/www/var/run/control.sock' ).
94
+ and_return( true )
91
95
  Mongrel2::Config::Setting.create( key: 'control_port', value: 'ipc://var/run/control.sock' )
92
96
  @server.control_socket_uri.should == 'ipc:///usr/local/www/var/run/control.sock'
93
97
  end
94
98
 
99
+ it "raises an error if the control socket path doesn't point to a UNIX socket" do
100
+ expect {
101
+ @server.control_socket
102
+ }.to raise_error( RuntimeError, /unable to find the socket/i )
103
+ end
104
+
95
105
  it "can create a Mongrel2::Control for its control port" do
96
106
  Mongrel2::Config::Setting.dataset.truncate
107
+ FileTest.stub( :socket? ).with( '/usr/local/www/run/control' ).
108
+ and_return( true )
97
109
  sock = @server.control_socket
98
110
  sock.should be_a( Mongrel2::Control )
99
111
  sock.close
@@ -35,7 +35,9 @@ describe Mongrel2::Control do
35
35
 
36
36
  Mongrel2.instance_variable_set( :@zmq_ctx, @ctx )
37
37
 
38
- @control = Mongrel2::Control.new
38
+ FileTest.stub( :socket? ).with( 'var/run/control' ). and_return( true )
39
+
40
+ @control = Mongrel2::Control.new( 'ipc://var/run/control' )
39
41
  end
40
42
 
41
43
  after( :all ) do
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.30.1
4
+ version: 0.31.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-07-27 00:00:00.000000000 Z
39
+ date: 2012-07-30 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
metadata.gz.sig CHANGED
Binary file