Permalink
Browse files

It makes absolutely NO sense to hardcode any default ZMQ connection s…

…pecs into anything.
  • Loading branch information...
1 parent 312b4a1 commit 46c6404eb8ae8fa22ecc6aca09f3b8cde390e5f3 Nathan Duran committed Apr 9, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/rack/handler/mongrel2.rb
@@ -7,11 +7,13 @@ class Mongrel2
class << self
def run(app, options = {})
options = {
- :recv => 'tcp://127.0.0.1:9997' || ENV['RACK_MONGREL2_RECV'],
- :send => 'tcp://127.0.0.1:9996' || ENV['RACK_MONGREL2_SEND'],
+ :recv => ENV['RACK_MONGREL2_RECV'],
+ :send => ENV['RACK_MONGREL2_SEND'],
:uuid => ENV['RACK_MONGREL2_UUID']
}.merge(options)
-
+
+ raise ArgumentError.new('Must specify an :recv or set RACK_MONGREL2_RECV') if options[:recv].nil?
+ raise ArgumentError.new('Must specify an :recv or set RACK_MONGREL2_SEND') if options[:send].nil?
raise ArgumentError.new('Must specify an :uuid or set RACK_MONGREL2_UUID') if options[:uuid].nil?
conn = ::Mongrel2::Connection.new(options[:uuid], options[:recv], options[:send])

0 comments on commit 46c6404

Please sign in to comment.