diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-16 21:14:21 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-17 16:08:34 -0500 |
commit | 553b86fc751c751db504bcbe2d033eb2bb5b6a0b (patch) | |
tree | a91d105f31ce626e216d7cc93607a68f56cd070b | |
parent | e20589c9be09c7272d73492d4b0f7b24e5595571 (diff) | |
download | rails-553b86fc751c751db504bcbe2d033eb2bb5b6a0b.tar.gz rails-553b86fc751c751db504bcbe2d033eb2bb5b6a0b.tar.bz2 rails-553b86fc751c751db504bcbe2d033eb2bb5b6a0b.zip |
Remove deprecated support to old `config.ru` that use the application class as argument of `run`
-rw-r--r-- | railties/CHANGELOG.md | 4 | ||||
-rw-r--r-- | railties/lib/rails/commands/server/server_command.rb | 13 | ||||
-rw-r--r-- | railties/test/application/server_test.rb | 14 |
3 files changed, 4 insertions, 27 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 178f556460..46bdcf49f8 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated support to old `config.ru` that use the application class as argument of `run`. + + *Rafael Mendonça França* + * Remove deprecated `environment` argument from the rails commands. *Rafael Mendonça França* diff --git a/railties/lib/rails/commands/server/server_command.rb b/railties/lib/rails/commands/server/server_command.rb index 6c4cc3cb86..47c3f05bb3 100644 --- a/railties/lib/rails/commands/server/server_command.rb +++ b/railties/lib/rails/commands/server/server_command.rb @@ -21,19 +21,6 @@ module Rails set_environment end - def app - @app ||= begin - app = super - if app.is_a?(Class) - ActiveSupport::Deprecation.warn(<<-MSG.squish) - Using `Rails::Application` subclass to start the server is deprecated and will be removed in Rails 6.0. - Please change `run #{app}` to `run Rails.application` in config.ru. - MSG - end - app.respond_to?(:to_app) ? app.to_app : app - end - end - def opt_parser Options.new end diff --git a/railties/test/application/server_test.rb b/railties/test/application/server_test.rb index ab9e910aed..f4bd09903a 100644 --- a/railties/test/application/server_test.rb +++ b/railties/test/application/server_test.rb @@ -18,20 +18,6 @@ module ApplicationTests teardown_app end - test "deprecate support of older `config.ru`" do - remove_file "config.ru" - app_file "config.ru", <<-RUBY - require_relative 'config/environment' - run AppTemplate::Application - RUBY - - server = Rails::Server.new(config: "#{app_path}/config.ru") - server.app - - log = File.read(Rails.application.config.paths["log"].first) - assert_match(/DEPRECATION WARNING: Using `Rails::Application` subclass to start the server is deprecated/, log) - end - test "restart rails server with custom pid file path" do skip "PTY unavailable" unless available_pty? |