diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2019-01-05 13:50:09 +0200 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2019-01-05 13:54:35 +0200 |
commit | 6b8048173d4a0176c9ab4694ba0f6ff331b20619 (patch) | |
tree | c5df8411efd8d768cab71713f0af5fd7c454373c /railties/lib/rails/generators | |
parent | 86517942e469193e8624d5078d718785552c1270 (diff) | |
download | rails-6b8048173d4a0176c9ab4694ba0f6ff331b20619.tar.gz rails-6b8048173d4a0176c9ab4694ba0f6ff331b20619.tar.bz2 rails-6b8048173d4a0176c9ab4694ba0f6ff331b20619.zip |
Add `--skip-action-text` option to `rails new`
Since PR#34816 was merged in c6ef670aee186a2880b7be59c4c6892b5c983e58,
we should add this option for flexibility, and consistency.
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 10 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/application.rb.tt | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 7b30f8b9ca..3778690ef6 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -47,6 +47,9 @@ module Rails class_option :skip_action_mailbox, type: :boolean, default: false, desc: "Skip Action Mailbox gem" + class_option :skip_action_text, type: :boolean, default: false, + desc: "Skip Action Text gem" + class_option :skip_active_record, type: :boolean, aliases: "-O", default: false, desc: "Skip Active Record files" @@ -204,7 +207,8 @@ module Rails :skip_action_cable ), skip_active_storage?, - skip_action_mailbox? + skip_action_mailbox?, + skip_action_text? ].flatten.none? end @@ -237,6 +241,10 @@ module Rails options[:skip_action_mailbox] || skip_active_storage? end + def skip_action_text? # :doc: + options[:skip_action_text] || skip_active_storage? + end + class GemfileEntry < Struct.new(:name, :version, :comment, :options, :commented_out) def initialize(name, version, comment, options = {}, commented_out = false) super diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/application.rb.tt index 60016f76f2..1b0ee54071 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb.tt @@ -12,6 +12,7 @@ require "active_job/railtie" require "action_controller/railtie" <%= comment_if :skip_action_mailer %>require "action_mailer/railtie" <%= comment_if :skip_action_mailbox %>require "action_mailbox/engine" +<%= comment_if :skip_action_text %>require "action_text/engine" require "action_view/railtie" <%= comment_if :skip_action_cable %>require "action_cable/engine" <%= comment_if :skip_sprockets %>require "sprockets/railtie" |