From 1919849d86822545dcfeb7cd9fe2f6e121422a21 Mon Sep 17 00:00:00 2001 From: Steve Polito Date: Wed, 8 May 2024 06:06:19 -0400 Subject: [PATCH] Update template The template won't have access to Suspenders, since it's called in isolation. --- lib/install/web.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/install/web.rb b/lib/install/web.rb index 6c13f548..a77c7d74 100644 --- a/lib/install/web.rb +++ b/lib/install/web.rb @@ -1,4 +1,10 @@ -extend Suspenders::Generators::Helpers +def node_not_installed? + !node_version.present? +end + +def node_version_unsupported? + node_version < "20.0.0" +end def apply_template! if node_not_installed? || node_version_unsupported? @@ -7,7 +13,7 @@ def apply_template! === Node version unsupported === - Suspenders requires Node >= #{Suspenders::MINIMUM_NODE_VERSION} + Suspenders requires Node >= 20.0.0 ERROR fail Rails::Generators::Error, message