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 --- examples/big_app_gc.rb | 1 + examples/echo.ru | 1 + examples/logger_mp_safe.rb | 1 + examples/unicorn.conf.minimal.rb | 1 + examples/unicorn.conf.rb | 1 + 5 files changed, 5 insertions(+) (limited to 'examples') diff --git a/examples/big_app_gc.rb b/examples/big_app_gc.rb index c1bae10..0baea26 100644 --- a/examples/big_app_gc.rb +++ b/examples/big_app_gc.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: false # see {Unicorn::OobGC}[https://yhbt.net/unicorn/Unicorn/OobGC.html] # Unicorn::OobGC was broken in Unicorn v3.3.1 - v3.6.1 and fixed in v3.6.2 diff --git a/examples/echo.ru b/examples/echo.ru index e982180..453a5e6 100644 --- a/examples/echo.ru +++ b/examples/echo.ru @@ -1,4 +1,5 @@ #\-E none +# frozen_string_literal: false # # Example application that echoes read data back to the HTTP client. # This emulates the old echo protocol people used to run. diff --git a/examples/logger_mp_safe.rb b/examples/logger_mp_safe.rb index 05ad3fa..f2c0500 100644 --- a/examples/logger_mp_safe.rb +++ b/examples/logger_mp_safe.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Multi-Processing-safe monkey patch for Logger # # This monkey patch fixes the case where "preload_app true" is used and diff --git a/examples/unicorn.conf.minimal.rb b/examples/unicorn.conf.minimal.rb index 46fd634..4f96ede 100644 --- a/examples/unicorn.conf.minimal.rb +++ b/examples/unicorn.conf.minimal.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Minimal sample configuration file for Unicorn (not Rack) when used # with daemonization (unicorn -D) started in your working directory. # diff --git a/examples/unicorn.conf.rb b/examples/unicorn.conf.rb index d90bdc4..5bae830 100644 --- a/examples/unicorn.conf.rb +++ b/examples/unicorn.conf.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: false # Sample verbose configuration file for Unicorn (not Rack) # # This configuration file documents many features of Unicorn -- cgit v1.2.3-24-ge0c7