From db4c6f5ecbdc2851fe5947fa36725f43cce52280 Mon Sep 17 00:00:00 2001 From: Orhan Toy Date: Mon, 1 Apr 2019 18:39:15 +0200 Subject: Include final newline in generated .ruby-version --- railties/lib/rails/generators/rails/app/templates/ruby-version.tt | 2 +- railties/test/generators/app_generator_test.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/lib/rails/generators/rails/app/templates/ruby-version.tt b/railties/lib/rails/generators/rails/app/templates/ruby-version.tt index bac1339923..096cfd36a8 100644 --- a/railties/lib/rails/generators/rails/app/templates/ruby-version.tt +++ b/railties/lib/rails/generators/rails/app/templates/ruby-version.tt @@ -1 +1 @@ -<%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" -%> +<%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %> diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index d5a3599f67..d30cd9e718 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -968,6 +968,8 @@ class AppGeneratorTest < Rails::Generators::TestCase else assert_match(/#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}/, content) end + + assert content.end_with?("\n"), "expected .ruby-version to end with newline" end end -- cgit v1.2.3