From 69be13f7a7af7295fde063b5629259f9c39a7ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 19 Nov 2019 20:59:42 +0100 Subject: [PATCH] Keep default puma settings in the test environment The test environment was using the file in `config/puma.rb`, meaning it wouldn't work with Rails 5.1, which uses a different setup for Puma. I've decided to create a new file called `defaults.rb`, which will be used in every environment but development and test. We could also add an empty file in `config/puma/test.rb`; I think that's less intuitive, but it's a subjective opinion. --- config/{puma.rb => puma/defaults.rb} | 3 +-- config/puma/preproduction.rb | 2 +- config/puma/production.rb | 2 +- config/puma/staging.rb | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) rename config/{puma.rb => puma/defaults.rb} (90%) diff --git a/config/puma.rb b/config/puma/defaults.rb similarity index 90% rename from config/puma.rb rename to config/puma/defaults.rb index 9be47da0d..4f2ad945e 100644 --- a/config/puma.rb +++ b/config/puma/defaults.rb @@ -1,10 +1,9 @@ #!/usr/bin/env puma -rails_root = File.expand_path("../..", __FILE__) +rails_root = File.expand_path("../../..", __FILE__) directory rails_root rackup "#{rails_root}/config.ru" -environment "production" tag "" diff --git a/config/puma/preproduction.rb b/config/puma/preproduction.rb index 662d717be..cb965689c 100644 --- a/config/puma/preproduction.rb +++ b/config/puma/preproduction.rb @@ -1,5 +1,5 @@ #!/usr/bin/env puma -_load_from File.expand_path("../../puma.rb", __FILE__) +_load_from File.expand_path("../defaults.rb", __FILE__) environment "preproduction" diff --git a/config/puma/production.rb b/config/puma/production.rb index 7b693ef07..69d5508e3 100644 --- a/config/puma/production.rb +++ b/config/puma/production.rb @@ -1,5 +1,5 @@ #!/usr/bin/env puma -_load_from File.expand_path("../../puma.rb", __FILE__) +_load_from File.expand_path("../defaults.rb", __FILE__) environment "production" diff --git a/config/puma/staging.rb b/config/puma/staging.rb index 1097290ea..7f0321680 100644 --- a/config/puma/staging.rb +++ b/config/puma/staging.rb @@ -1,5 +1,5 @@ #!/usr/bin/env puma -_load_from File.expand_path("../../puma.rb", __FILE__) +_load_from File.expand_path("../defaults.rb", __FILE__) environment "staging"