From a5d88662a519406eea6f180a010af8ef829464e7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Nov 2015 08:52:29 +0000 Subject: Ruby 1.9.3+-only cleanups unicorn 5 will only support Ruby 1.9.3 and later, so remove some checks for Hash#compare_by_identity and IO.copy_stream which we know exist in Ruby 1.9. Favor &:sym proc dispatch to avoid unnecessary captures and bytecode size increases, too. Finally, ensure we fail fast by converting some literal hashes to use non-arrow syntax for symbolic keys. --- lib/rainbows/configurator.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/rainbows/configurator.rb') diff --git a/lib/rainbows/configurator.rb b/lib/rainbows/configurator.rb index 92dacd6..73820a1 100644 --- a/lib/rainbows/configurator.rb +++ b/lib/rainbows/configurator.rb @@ -21,14 +21,14 @@ # stdout_path "/path/to/output.log" module Rainbows::Configurator Unicorn::Configurator::DEFAULTS.merge!({ - :use => Rainbows::Base, - :worker_connections => 50, - :keepalive_timeout => 5, - :keepalive_requests => 100, - :client_max_body_size => 1024 * 1024, - :client_header_buffer_size => 1024, - :client_max_header_size => 112 * 1024, - :copy_stream => IO.respond_to?(:copy_stream) ? IO : false, + use: Rainbows::Base, + worker_connections: 50, + keepalive_timeout: 5, + keepalive_requests: 100, + client_max_body_size: 1024 * 1024, + client_header_buffer_size: 1024, + client_max_header_size: 112 * 1024, + copy_stream: IO, }) # Configures \Rainbows! with a given concurrency model to +use+ and -- cgit v1.2.3-24-ge0c7