From ad13aa909e10742ac7d63a6d1185ff7e4c056315 Mon Sep 17 00:00:00 2001 From: Petrik Date: Fri, 1 May 2026 08:52:36 +0200 Subject: [PATCH] [rails] Enable frozen string literal across app, including dependencies --- frameworks/rails/Gemfile | 1 + frameworks/rails/Gemfile.lock | 6 ++++++ frameworks/rails/app/controllers/benchmark_controller.rb | 2 -- frameworks/rails/config/application.rb | 2 -- frameworks/rails/config/boot.rb | 1 + frameworks/rails/config/initializers/bootsnap.rb | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 frameworks/rails/config/initializers/bootsnap.rb diff --git a/frameworks/rails/Gemfile b/frameworks/rails/Gemfile index 6373d004e..cc909ec39 100644 --- a/frameworks/rails/Gemfile +++ b/frameworks/rails/Gemfile @@ -3,5 +3,6 @@ source 'https://rubygems.org' gem 'rails', '~> 8.0' gem 'puma', '~> 7.2' gem 'pg', '~> 1.5' +gem 'bootsnap', require: false gem 'connection_pool' gem 'thruster', require: false diff --git a/frameworks/rails/Gemfile.lock b/frameworks/rails/Gemfile.lock index 28ba127e8..8f3e6a90d 100644 --- a/frameworks/rails/Gemfile.lock +++ b/frameworks/rails/Gemfile.lock @@ -77,6 +77,8 @@ GEM uri (>= 0.13.1) base64 (0.3.0) bigdecimal (4.1.2) + bootsnap (1.24.1) + msgpack (~> 1.2) builder (3.3.0) concurrent-ruby (1.3.6) connection_pool (3.0.2) @@ -111,6 +113,7 @@ GEM minitest (6.0.5) drb (~> 2.0) prism (~> 1.5) + msgpack (1.8.0) net-imap (0.6.4) date net-protocol @@ -204,6 +207,7 @@ PLATFORMS x86_64-linux DEPENDENCIES + bootsnap connection_pool pg (~> 1.5) puma (~> 7.2) @@ -225,6 +229,7 @@ CHECKSUMS activesupport (8.1.3) sha256=21a5e0dfbd4c3ddd9e1317ec6a4d782fa226e7867dc70b0743acda81a1dca20e base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + bootsnap (1.24.1) sha256=d7faea1dc24aa5b22dacc049c9236b64ebf60b14dd49c615e15d8402375d39ef builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a @@ -244,6 +249,7 @@ CHECKSUMS marcel (1.1.0) sha256=fdcfcfa33cc52e93c4308d40e4090a5d4ea279e160a7f6af988260fa970e0bee mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef minitest (6.0.5) sha256=f007d7246bf4feea549502842cd7c6aba8851cdc9c90ba06de9c476c0d01155c + msgpack (1.8.0) sha256=e64ce0212000d016809f5048b48eb3a65ffb169db22238fb4b72472fecb2d732 net-imap (0.6.4) sha256=9a5598c67a3022c284d98430ef1d4948e7dbdb62596f61081ea8ca933270a02b net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3 net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8 diff --git a/frameworks/rails/app/controllers/benchmark_controller.rb b/frameworks/rails/app/controllers/benchmark_controller.rb index f19693442..b4cda1f50 100644 --- a/frameworks/rails/app/controllers/benchmark_controller.rb +++ b/frameworks/rails/app/controllers/benchmark_controller.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'zlib' require 'pg' diff --git a/frameworks/rails/config/application.rb b/frameworks/rails/config/application.rb index 71ac651b5..1347e53ab 100644 --- a/frameworks/rails/config/application.rb +++ b/frameworks/rails/config/application.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'rails' require 'action_controller/railtie' diff --git a/frameworks/rails/config/boot.rb b/frameworks/rails/config/boot.rb index 93f96d575..04a5b03a9 100644 --- a/frameworks/rails/config/boot.rb +++ b/frameworks/rails/config/boot.rb @@ -1,3 +1,4 @@ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" +require "bootsnap/setup" diff --git a/frameworks/rails/config/initializers/bootsnap.rb b/frameworks/rails/config/initializers/bootsnap.rb new file mode 100644 index 000000000..f61fd7355 --- /dev/null +++ b/frameworks/rails/config/initializers/bootsnap.rb @@ -0,0 +1 @@ +Bootsnap.enable_frozen_string_literal