diff options
9 files changed, 18 insertions, 17 deletions
diff --git a/actioncable/app/assets/javascripts/action_cable.js b/actioncable/app/assets/javascripts/action_cable.js index 280adbfa83..4efab2ed46 100644 --- a/actioncable/app/assets/javascripts/action_cable.js +++ b/actioncable/app/assets/javascripts/action_cable.js @@ -465,14 +465,15 @@ } } function createWebSocketURL(url) { - if (url && !/^wss?:/i.test(url)) { + var webSocketURL = typeof url === "function" ? url() : url; + if (webSocketURL && !/^wss?:/i.test(webSocketURL)) { var a = document.createElement("a"); - a.href = url; + a.href = webSocketURL; a.href = a.href; a.protocol = a.protocol.replace("http", "ws"); return a.href; } else { - return url; + return webSocketURL; } } exports.Connection = Connection; diff --git a/actioncable/app/javascript/action_cable/index.js b/actioncable/app/javascript/action_cable/index.js index e9892ee821..e679745fd7 100644 --- a/actioncable/app/javascript/action_cable/index.js +++ b/actioncable/app/javascript/action_cable/index.js @@ -30,7 +30,7 @@ export function getConfig(name) { } export function createWebSocketURL(url) { - const webSocketURL = typeof url === 'function' ? url() : url; + const webSocketURL = typeof url === "function" ? url() : url if (webSocketURL && !/^wss?:/i.test(webSocketURL)) { const a = document.createElement("a") diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index c4565ca272..cf71b4803b 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -242,7 +242,7 @@ module ActionView #:nodoc: @_config = ActiveSupport::InheritableOptions.new unless formats == NULL - ActiveSupport::Deprecation.warn <<~eowarn + ActiveSupport::Deprecation.warn <<~eowarn.squish Passing formats to ActionView::Base.new is deprecated eowarn end @@ -251,7 +251,7 @@ module ActionView #:nodoc: when ActionView::LookupContext @lookup_context = lookup_context else - ActiveSupport::Deprecation.warn <<~eowarn + ActiveSupport::Deprecation.warn <<~eowarn.squish ActionView::Base instances should be constructed with a lookup context, assignments, and a controller. eowarn @@ -278,7 +278,7 @@ module ActionView #:nodoc: def compiled_method_container if self.class == ActionView::Base - ActiveSupport::Deprecation.warn <<~eowarn + ActiveSupport::Deprecation.warn <<~eowarn.squish ActionView::Base instances must implement `compiled_method_container` or use the class method `with_empty_template_cache` for constructing an ActionView::Base instances that has an empty cache. diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb index 10cd61bbd6..2eaf188ecf 100644 --- a/actionview/lib/action_view/lookup_context.rb +++ b/actionview/lib/action_view/lookup_context.rb @@ -154,7 +154,7 @@ module ActionView view_paths = build_view_paths((@view_paths.paths + self.class.fallbacks).uniq) if block_given? - ActiveSupport::Deprecation.warn <<~eowarn + ActiveSupport::Deprecation.warn <<~eowarn.squish Calling `with_fallbacks` with a block is deprecated. Call methods on the lookup context returned by `with_fallbacks` instead. eowarn diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index 3dc81ffccf..6981ea6ecd 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -1051,7 +1051,7 @@ module ActiveRecord def assume_migrated_upto_version(version, migrations_paths = nil) unless migrations_paths.nil? - ActiveSupport::Deprecation.warn(<<~MSG) + ActiveSupport::Deprecation.warn(<<~MSG.squish) Passing migrations_paths to #assume_migrated_upto_version is deprecated and will be removed in Rails 6.1. MSG end diff --git a/activestorage/app/models/active_storage/variation.rb b/activestorage/app/models/active_storage/variation.rb index 67568772da..41b5a45f53 100644 --- a/activestorage/app/models/active_storage/variation.rb +++ b/activestorage/app/models/active_storage/variation.rb @@ -64,7 +64,7 @@ class ActiveStorage::Variation begin require "image_processing" rescue LoadError - ActiveSupport::Deprecation.warn <<~WARNING + ActiveSupport::Deprecation.warn <<~WARNING.squish Generating image variants will require the image_processing gem in Rails 6.1. Please add `gem 'image_processing', '~> 1.2'` to your Gemfile. WARNING diff --git a/activestorage/lib/active_storage/transformers/image_processing_transformer.rb b/activestorage/lib/active_storage/transformers/image_processing_transformer.rb index 7f8685b72d..506150576c 100644 --- a/activestorage/lib/active_storage/transformers/image_processing_transformer.rb +++ b/activestorage/lib/active_storage/transformers/image_processing_transformer.rb @@ -22,7 +22,7 @@ module ActiveStorage def operations transformations.each_with_object([]) do |(name, argument), list| if name.to_s == "combine_options" - ActiveSupport::Deprecation.warn <<~WARNING + ActiveSupport::Deprecation.warn <<~WARNING.squish Active Storage's ImageProcessing transformer doesn't support :combine_options, as it always generates a single ImageMagick command. Passing :combine_options will not be supported in Rails 6.1. diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 9e8b38733a..88f9ac06f6 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -268,9 +268,9 @@ *Jose Luis Duran* -* Deprecate support for using the `HOST` environment to specify the server IP. +* Deprecate support for using the `HOST` environment variable to specify the server IP. - The `BINDING` environment should be used instead. + The `BINDING` environment variable should be used instead. Fixes #29516. diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 47c3f05bb3..43f7b76fd6 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -221,8 +221,8 @@ module Rails if ENV["HOST"] && !ENV["BINDING"] ActiveSupport::Deprecation.warn(<<-MSG.squish) - Using the `HOST` environment to specify the IP is deprecated and will be removed in Rails 6.1. - Please use `BINDING` environment instead. + Using the `HOST` environment variable to specify the IP is deprecated and will be removed in Rails 6.1. + Please use `BINDING` environment variable instead. MSG return ENV["HOST"] @@ -255,7 +255,7 @@ module Rails end def self.banner(*) - "rails server [thin/puma/webrick] [options]" + "rails server -u [thin/puma/webrick] [options]" end def prepare_restart @@ -264,7 +264,7 @@ module Rails def deprecate_positional_rack_server_and_rewrite_to_option(original_options) if using - ActiveSupport::Deprecation.warn(<<~MSG) + ActiveSupport::Deprecation.warn(<<~MSG.squish) Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead. |