From b62c1ac2ec1cc3e75a400218fdfd26e0e6ccfa78 Mon Sep 17 00:00:00 2001 From: Hartley McGuire Date: Mon, 16 Oct 2023 23:46:25 -0400 Subject: [PATCH] Fix extra blank line when no error_highlight A new condition was recently [added][1] to exclude error_highlight from the Gemfile when the Ruby version is 3.2 or greater. However, this change leads to an extra blank line after `gem "spring"` on Ruby 3.2+. This could also happen to new apps generated on Rubies < 3.1, but my guess is that is less common. This commit fixes the issue by moving the extra blank line into the condition. [1]: d7b395145c644434b1c2be07ef334ea5cb643b75 --- railties/lib/rails/generators/rails/app/templates/Gemfile.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile.tt b/railties/lib/rails/generators/rails/app/templates/Gemfile.tt index 09d6cfe4813..1937e222833 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile.tt +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile.tt @@ -50,8 +50,8 @@ group :development do <%- end -%> # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" - <%- if RUBY_VERSION >= "3.1" && RUBY_VERSION < "3.2" -%> + gem "error_highlight", ">= 0.4.0", platforms: [:ruby] <%- end -%> end