Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Rails 7.2 in web template #1237

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/install/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def node_version_unsupported?
node_version < "20.0.0"
end

def rails_version_unsupported?
Rails.gem_version < Gem::Version.new("7.2.0")
end

def apply_template!
if node_not_installed? || node_version_unsupported?
message = <<~ERROR
Expand All @@ -22,6 +26,22 @@ def apply_template!

fail Rails::Generators::Error, message
end

if rails_version_unsupported?
message = <<~ERROR


=== Rails version unsupported for creating new apps ===

Suspenders requires Rails >= 7.2.0 when creating a **new** app.

Suspenders can be added to an **existing** app meeting "~> 7.0.0".

ERROR

fail Rails::Generators::Error, message
end

if options[:database] == "postgresql" && options[:skip_test] && options[:skip_rubocop]
after_bundle do
gem_group :development, :test do
Expand Down