Skip to content

Commit

Permalink
Hide Sidekiq, Tomo when they conflict with Solid, Kamal
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson committed Sep 17, 2024
1 parent 2c5cd4e commit f5d2b11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/generators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ shoulda:
sidekiq:
prompt: "Sidekiq"
description: "Install sidekiq gem to use in production"
requires: active_job
requires:
- active_job
- skip_solid

staging:
prompt: "Staging environment"
Expand All @@ -141,6 +143,7 @@ thor:
tomo:
prompt: "Tomo"
description: "Install tomo gem for SSH-based deployment"
requires: skip_kamal

vcr:
prompt: "VCR"
Expand Down
9 changes: 9 additions & 0 deletions lib/nextgen/rails_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ def active_job?
!skip_default_feature?(:active_job)
end

def skip_kamal?
# Depending on the Rails version, kamal may not exist, in which case we can consider it "skipped".
!skippable_features.include?(:kamal) || skip_default_feature?(:kamal)
end

def skip_solid?
!skippable_features.include?(:solid) || skip_default_feature?(:solid)
end

def enable_optional_feature!(feature)
raise ArgumentError, "Unknown feature: #{feature}" unless optional_features.include?(feature)

Expand Down

0 comments on commit f5d2b11

Please sign in to comment.