From e9a73410630fbc46f547ab5c5d24efb2c569bb69 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 8 Feb 2024 12:16:31 +0000 Subject: treewide: future-proof frozen_string_literal changes Once again Ruby seems ready to introduce more incompatibilities and force busywork upon maintainers[1]. In order to avoid incompatibilities in the future, I used a Perl script[2] to prepend `frozen_string_literal: false' to every Ruby file. Somebody interested will have to go through every Ruby source file and enable frozen_string_literal once they've thoroughly verified it's safe to do so. [1] https://bugs.ruby-lang.org/issues/20205 [2] https://yhbt.net/add-fsl.git/74d7689/s/?b=add-fsl.perl --- t/broken-app.ru | 1 + t/client_body_buffer_size.ru | 1 + t/detach.ru | 1 + t/env.ru | 1 + t/fails-rack-lint.ru | 1 + t/heartbeat-timeout.ru | 1 + t/integration.ru | 1 + t/listener_names.ru | 1 + t/oob_gc.ru | 1 + t/oob_gc_path.ru | 1 + t/pid.ru | 1 + t/preread_input.ru | 1 + t/reopen-logs.ru | 1 + t/t0013.ru | 1 + t/t0014.ru | 1 + t/t0301.ru | 1 + 16 files changed, 16 insertions(+) (limited to 't') diff --git a/t/broken-app.ru b/t/broken-app.ru index d05d7ab..5966bff 100644 --- a/t/broken-app.ru +++ b/t/broken-app.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false # we do not want Rack::Lint or anything to protect us use Rack::ContentLength use Rack::ContentType, "text/plain" diff --git a/t/client_body_buffer_size.ru b/t/client_body_buffer_size.ru index 44161a5..1a0fb16 100644 --- a/t/client_body_buffer_size.ru +++ b/t/client_body_buffer_size.ru @@ -1,4 +1,5 @@ #\ -E none +# frozen_string_literal: false app = lambda do |env| input = env['rack.input'] case env["PATH_INFO"] diff --git a/t/detach.ru b/t/detach.ru index bbd998e..8d35951 100644 --- a/t/detach.ru +++ b/t/detach.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false use Rack::ContentType, "text/plain" fifo_path = ENV["TEST_FIFO"] or abort "TEST_FIFO not set" run lambda { |env| diff --git a/t/env.ru b/t/env.ru index 388412e..86c3cfa 100644 --- a/t/env.ru +++ b/t/env.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false use Rack::ContentLength use Rack::ContentType, "text/plain" run lambda { |env| [ 200, {}, [ env.inspect << "\n" ] ] } diff --git a/t/fails-rack-lint.ru b/t/fails-rack-lint.ru index 82bfb5f..8b8b5ec 100644 --- a/t/fails-rack-lint.ru +++ b/t/fails-rack-lint.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false # This rack app returns an invalid status code, which will cause # Rack::Lint to throw an exception if it is present. This # is used to check whether Rack::Lint is in the stack or not. diff --git a/t/heartbeat-timeout.ru b/t/heartbeat-timeout.ru index 3eeb5d6..ccc6a8e 100644 --- a/t/heartbeat-timeout.ru +++ b/t/heartbeat-timeout.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false use Rack::ContentLength headers = { 'content-type' => 'text/plain' } run lambda { |env| diff --git a/t/integration.ru b/t/integration.ru index 888833a..6df481c 100644 --- a/t/integration.ru +++ b/t/integration.ru @@ -1,4 +1,5 @@ #!ruby +# frozen_string_literal: false # Copyright (C) unicorn hackers # License: GPL-3.0+ diff --git a/t/listener_names.ru b/t/listener_names.ru index edb4e6a..f52c59b 100644 --- a/t/listener_names.ru +++ b/t/listener_names.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false use Rack::ContentLength use Rack::ContentType, "text/plain" names = Unicorn.listener_names.inspect # rely on preload_app=true diff --git a/t/oob_gc.ru b/t/oob_gc.ru index 224cb06..2ae58a8 100644 --- a/t/oob_gc.ru +++ b/t/oob_gc.ru @@ -1,4 +1,5 @@ #\-E none +# frozen_string_literal: false require 'unicorn/oob_gc' use Rack::ContentLength use Rack::ContentType, "text/plain" diff --git a/t/oob_gc_path.ru b/t/oob_gc_path.ru index 7f40601..5358222 100644 --- a/t/oob_gc_path.ru +++ b/t/oob_gc_path.ru @@ -1,4 +1,5 @@ #\-E none +# frozen_string_literal: false require 'unicorn/oob_gc' use Rack::ContentLength use Rack::ContentType, "text/plain" diff --git a/t/pid.ru b/t/pid.ru index f5fd31f..b49b137 100644 --- a/t/pid.ru +++ b/t/pid.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false use Rack::ContentLength use Rack::ContentType, "text/plain" run lambda { |env| [ 200, {}, [ "#$$\n" ] ] } diff --git a/t/preread_input.ru b/t/preread_input.ru index 18af221..5f68fe9 100644 --- a/t/preread_input.ru +++ b/t/preread_input.ru @@ -1,4 +1,5 @@ #\-E none +# frozen_string_literal: false require 'digest/md5' require 'unicorn/preread_input' use Unicorn::PrereadInput diff --git a/t/reopen-logs.ru b/t/reopen-logs.ru index c39e8f6..488da85 100644 --- a/t/reopen-logs.ru +++ b/t/reopen-logs.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: false use Rack::ContentLength use Rack::ContentType, "text/plain" run lambda { |env| diff --git a/t/t0013.ru b/t/t0013.ru index 48a3a34..e425093 100644 --- a/t/t0013.ru +++ b/t/t0013.ru @@ -1,4 +1,5 @@ #\ -E none +# frozen_string_literal: false use Rack::ContentLength use Rack::ContentType, 'text/plain' app = lambda do |env| diff --git a/t/t0014.ru b/t/t0014.ru index b0bd2b7..686d214 100644 --- a/t/t0014.ru +++ b/t/t0014.ru @@ -1,4 +1,5 @@ #\ -E none +# frozen_string_literal: false use Rack::ContentLength use Rack::ContentType, 'text/plain' app = lambda do |env| diff --git a/t/t0301.ru b/t/t0301.ru index ce68213..54929b1 100644 --- a/t/t0301.ru +++ b/t/t0301.ru @@ -1,4 +1,5 @@ #\-N --debug +# frozen_string_literal: false run(lambda do |env| case env['PATH_INFO'] when '/vars' -- cgit v1.2.3-24-ge0c7