1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Merge pull request #751 from costi/compat_1_8_7

Ruby 1.8.7 compatibility fixes
This commit is contained in:
Evan Phoenix 2015-07-31 12:04:38 -07:00
commit d70a791a94
3 changed files with 5 additions and 4 deletions

View file

@ -104,8 +104,9 @@ module Puma
rack_app, rack_options = Puma::Rack::Builder.parse_file(rackup)
@options.merge!(rack_options)
config_ru_binds = rack_options.each_with_object([]) do |(k, v), b|
b << v if k.to_s.start_with?("bind")
config_ru_binds = []
rack_options.each do |k, v|
config_ru_binds << v if k.to_s.start_with?("bind")
end
@options[:binds] = config_ru_binds unless config_ru_binds.empty?

View file

@ -25,7 +25,7 @@ class TestConfigFile < Test::Unit::TestCase
end
def test_double_bind_port
port = rand(30_000..40_000).to_s
port = (rand(10_000) + 30_000).to_s
with_env("PORT" => port) do
opts = { :binds => ["tcp://#{Configuration::DefaultTCPHost}:#{port}"], :config_file => "test/config/app.rb"}
conf = Puma::Configuration.new opts

View file

@ -191,7 +191,7 @@ class TestPumaServer < Test::Unit::TestCase
def test_prints_custom_error
@events = Puma::Events.strings
re = lambda { |err| [302, {'Content-Type' => 'text', 'Location' => 'foo.html'}, ['302 found']] }
@server = Puma::Server.new @app, @events, {lowlevel_error_handler: re}
@server = Puma::Server.new @app, @events, {:lowlevel_error_handler => re}
@server.app = proc { |e| raise "don't leak me bro" }
@server.add_tcp_listener @host, @port