diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2015-12-16 21:26:45 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2015-12-16 21:26:45 +0100 |
commit | eea6f7bcd834f14c59327ad05072c96799583f33 (patch) | |
tree | 113d23c6bc7309dcb69124f68d4da287fe9c5caf | |
parent | a70331c9d16e70951684978d00a81d72efe8c46c (diff) | |
download | rails-eea6f7bcd834f14c59327ad05072c96799583f33.tar.gz rails-eea6f7bcd834f14c59327ad05072c96799583f33.tar.bz2 rails-eea6f7bcd834f14c59327ad05072c96799583f33.zip |
Avoid Action Cable stubs on --skip-action-cable
Still missing the stuff in app/ – we need to basically switch from a *
match to specifically picking out what we need.
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config.ru.tt (renamed from railties/lib/rails/generators/rails/app/templates/config.ru) | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index d62a2e48eb..2a3f16c02e 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -57,7 +57,7 @@ module Rails directory 'app' keep_file 'app/assets/images' - keep_file 'app/assets/javascripts/channels' + keep_file 'app/assets/javascripts/channels' unless options[:skip_action_cable] keep_file 'app/mailers' @@ -84,7 +84,7 @@ module Rails directory "environments" directory "initializers" directory "locales" - directory "redis" + directory "redis" unless options[:skip_action_cable] end end diff --git a/railties/lib/rails/generators/rails/app/templates/config.ru b/railties/lib/rails/generators/rails/app/templates/config.ru.tt index 849b5a1b88..4dddf0c03e 100644 --- a/railties/lib/rails/generators/rails/app/templates/config.ru +++ b/railties/lib/rails/generators/rails/app/templates/config.ru.tt @@ -1,8 +1,10 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -Rails.application.eager_load! +<%- unless options[:skip_action_cable] -%> +Rails.application.eager_load! require 'action_cable/process/logging' +<%- end -%> run Rails.application diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 945e890e5f..ab99030550 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -40,8 +40,10 @@ Rails.application.configure do # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + <%- unless options[:skip_action_cable] -%> # Action Cable should be mounted in a separate process for most production setups # config.action_cable.url = 'wss://example.com/cable' + <%- end -%> # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true |