From 67f7a30fa6d0ec9055edce5f15bac1f5d41f0526 Mon Sep 17 00:00:00 2001 From: Louis Antonopoulos Date: Fri, 1 Nov 2024 16:10:20 -0400 Subject: [PATCH] Simplify determination of unsupported Rails version https://github.com/thoughtbot/suspenders/pull/1237#discussion_r1826160769 --- lib/install/web.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/install/web.rb b/lib/install/web.rb index 7fbe181f..9cff72c2 100644 --- a/lib/install/web.rb +++ b/lib/install/web.rb @@ -10,18 +10,8 @@ def node_version_unsupported? node_version < "20.0.0" end -def rails_version - version = `rails --version`[/\d+\.\d+\.\d+/] - - return if version.blank? - - Gem::Version.new(version) -end - def rails_version_unsupported? - minimum_rails_version = Gem::Version.new("7.2.0") - - rails_version < minimum_rails_version + Rails.gem_version < Gem::Version.new("7.2.0") end def apply_template!