Skip to content

Commit

Permalink
Updates for frozen string literal compatibility. (#1376)
Browse files Browse the repository at this point in the history
  • Loading branch information
pat authored and nateberkopec committed Aug 3, 2017
1 parent 4db1dcd commit b25dc5d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/puma/cluster.rb
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/puma/configuration.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/puma/launcher.rb
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions test/test_http11.rb
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/test_persistent.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit b25dc5d

Please sign in to comment.