Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for frozen string literal compatibility. #1376

Merged
merged 1 commit into from Aug 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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