diff --git a/lib/puma/cluster.rb b/lib/puma/cluster.rb index 7bd3cc4cdb..d4c1957825 100644 --- a/lib/puma/cluster.rb +++ b/lib/puma/cluster.rb @@ -229,8 +229,8 @@ def wakeup! end def worker(index, master) - title = "puma: cluster worker #{index}: #{master}" - title << " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty? + title = "puma: cluster worker #{index}: #{master}" + title += " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty? $0 = title Signal.trap "SIGINT", "IGNORE" diff --git a/lib/puma/configuration.rb b/lib/puma/configuration.rb index 47f9401e44..1aea28bb67 100644 --- a/lib/puma/configuration.rb +++ b/lib/puma/configuration.rb @@ -341,7 +341,7 @@ def self.random_token end if bytes - token = "" + token = "".dup bytes.each_byte { |b| token << b.to_s(16) } else token = (0..count).to_a.map { rand(255).to_s(16) }.join diff --git a/lib/puma/launcher.rb b/lib/puma/launcher.rb index ea1c301e26..48867b2c85 100644 --- a/lib/puma/launcher.rb +++ b/lib/puma/launcher.rb @@ -298,8 +298,8 @@ def set_process_title end def title - buffer = "puma #{Puma::Const::VERSION} (#{@options[:binds].join(',')})" - buffer << " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty? + buffer = "puma #{Puma::Const::VERSION} (#{@options[:binds].join(',')})" + buffer += " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty? buffer end diff --git a/test/test_http11.rb b/test/test_http11.rb index 3eb72fec9d..2a30047065 100644 --- a/test/test_http11.rb +++ b/test/test_http11.rb @@ -166,8 +166,8 @@ def test_horrible_queries end # then large headers are rejected too - get = "GET /#{rand_data(10,120)} HTTP/1.1\r\n" - get << "X-Test: test\r\n" * (80 * 1024) + get = "GET /#{rand_data(10,120)} HTTP/1.1\r\n" + get += "X-Test: test\r\n" * (80 * 1024) assert_raises Puma::HttpParserError do parser.execute({}, get, 0) parser.reset diff --git a/test/test_persistent.rb b/test/test_persistent.rb index 42e35b0ad9..94d7cc19a6 100644 --- a/test/test_persistent.rb +++ b/test/test_persistent.rb @@ -37,7 +37,7 @@ def teardown end def lines(count, s=@client) - str = "" + str = "".dup Timeout.timeout(5) do count.times { str << s.gets } end @@ -192,7 +192,7 @@ def test_two_requests_in_one_chunk @server.persistent_timeout = 3 req = @valid_request.to_s - req << "GET /second HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\n\r\n" + req += "GET /second HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\n\r\n" @client << req @@ -209,7 +209,7 @@ def test_second_request_not_in_first_req_body @server.persistent_timeout = 3 req = @valid_request.to_s - req << "GET /second HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\n\r\n" + req += "GET /second HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\n\r\n" @client << req