diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rainbows/http_server.rb | 4 | ||||
-rw-r--r-- | lib/rainbows/response.rb | 4 | ||||
-rw-r--r-- | lib/rainbows/stream_response_epoll.rb | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index 429539c..33bb96c 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -82,10 +82,10 @@ class Rainbows::HttpServer < Unicorn::HttpServer end def use=(mod) - @use = mod.to_s.split(/::/)[-1].to_sym + @use = mod.to_s.split('::')[-1].to_sym new_defaults = { 'rainbows.model' => @use, - 'rack.multithread' => !!(mod.to_s =~ /Thread/), + 'rack.multithread' => mod.to_s.include?('Thread'), 'rainbows.autochunk' => [:Coolio,:Rev,:Epoll,:XEpoll, :EventMachine,:NeverBlock].include?(@use), } diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb index 3e48c65..ac50321 100644 --- a/lib/rainbows/response.rb +++ b/lib/rainbows/response.rb @@ -40,7 +40,7 @@ module Rainbows::Response else if /\n/ =~ value # avoiding blank, key-only cookies with /\n+/ - buf << value.split(/\n+/).map! { |v| "#{key}: #{v}\r\n" }.join + value.split(/\n+/).each { |v| buf << "#{key}: #{v}\r\n" } else buf << "#{key}: #{value}\r\n" end @@ -151,7 +151,7 @@ module Rainbows::Response 200 == status && /\Abytes=(\d+-\d*|\d*-\d+)\z/ =~ @hp.env['HTTP_RANGE'] or return - a, b = $1.split(/-/) + a, b = $1.split('-'.freeze) # HeaderHash is quite expensive, and Rack::File currently # uses a regular Ruby Hash with properly-cased headers the diff --git a/lib/rainbows/stream_response_epoll.rb b/lib/rainbows/stream_response_epoll.rb index 7c2f4f6..48ef298 100644 --- a/lib/rainbows/stream_response_epoll.rb +++ b/lib/rainbows/stream_response_epoll.rb @@ -39,7 +39,7 @@ module Rainbows::StreamResponseEpoll else if /\n/ =~ value # avoiding blank, key-only cookies with /\n+/ - buf << value.split(/\n+/).map! { |v| "#{key}: #{v}\r\n" }.join + value.split(/\n+/).each { |v| buf << "#{key}: #{v}\r\n" } else buf << "#{key}: #{value}\r\n" end |