From e152f83c64596e3c701d1b34175ae0fa8669c983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 29 Oct 2020 21:18:29 +0000 Subject: [PATCH] Remove deprecated `rake routes` tasks --- guides/source/6_1_release_notes.md | 2 + railties/CHANGELOG.md | 4 ++ railties/lib/rails/tasks.rb | 1 - railties/lib/rails/tasks/routes.rake | 9 --- railties/test/application/rake/routes_test.rb | 65 ------------------- 5 files changed, 6 insertions(+), 75 deletions(-) delete mode 100644 railties/lib/rails/tasks/routes.rake delete mode 100644 railties/test/application/rake/routes_test.rb diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index 5ada3dbd810..124eb1c87eb 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -45,6 +45,8 @@ Please refer to the [Changelog][railties] for detailed changes. * Remove deprecated `rake dev:cache` tasks. +* Remove deprecated `rake routes` tasks. + ### Deprecations ### Notable changes diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 2ac260414fc..4d7506e82e1 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -2,6 +2,10 @@ *Rafael Mendonça França* +* Remove deprecated `rake routes` tasks. + + *Rafael Mendonça França* + * Remove deprecated support for using the `HOST` environment variable to specify the server IP. *Rafael Mendonça França* diff --git a/railties/lib/rails/tasks.rb b/railties/lib/rails/tasks.rb index 513de65ff03..5c3bd837762 100644 --- a/railties/lib/rails/tasks.rb +++ b/railties/lib/rails/tasks.rb @@ -10,7 +10,6 @@ require "rake" middleware misc restart - routes tmp yarn zeitwerk diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake deleted file mode 100644 index 21ce900a8cd..00000000000 --- a/railties/lib/rails/tasks/routes.rake +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require "rails/command" -require "active_support/deprecation" - -task routes: :environment do - ActiveSupport::Deprecation.warn("Using `bin/rake routes` is deprecated and will be removed in Rails 6.1. Use `bin/rails routes` instead.\n") - Rails::Command.invoke "routes" -end diff --git a/railties/test/application/rake/routes_test.rb b/railties/test/application/rake/routes_test.rb deleted file mode 100644 index e0f5aad0009..00000000000 --- a/railties/test/application/rake/routes_test.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -require "isolation/abstract_unit" - -module ApplicationTests - module RakeTests - class RakeRoutesTest < ActiveSupport::TestCase - include ActiveSupport::Testing::Isolation - - setup :build_app - teardown :teardown_app - - test "`rake routes` outputs routes" do - app_file "config/routes.rb", <<-RUBY - Rails.application.routes.draw do - get '/cart', to: 'cart#show' - end - RUBY - - assert_equal <<~MESSAGE, run_rake_routes - Prefix Verb URI Pattern Controller#Action - cart GET /cart(.:format) cart#show - rails_postmark_inbound_emails POST /rails/action_mailbox/postmark/inbound_emails(.:format) action_mailbox/ingresses/postmark/inbound_emails#create - rails_relay_inbound_emails POST /rails/action_mailbox/relay/inbound_emails(.:format) action_mailbox/ingresses/relay/inbound_emails#create - rails_sendgrid_inbound_emails POST /rails/action_mailbox/sendgrid/inbound_emails(.:format) action_mailbox/ingresses/sendgrid/inbound_emails#create - rails_mandrill_inbound_health_check GET /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#health_check - rails_mandrill_inbound_emails POST /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#create - rails_mailgun_inbound_emails POST /rails/action_mailbox/mailgun/inbound_emails/mime(.:format) action_mailbox/ingresses/mailgun/inbound_emails#create - rails_conductor_inbound_emails GET /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#index - POST /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#create - new_rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/new(.:format) rails/conductor/action_mailbox/inbound_emails#new - edit_rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/:id/edit(.:format) rails/conductor/action_mailbox/inbound_emails#edit - rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#show - PATCH /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#update - PUT /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#update - DELETE /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#destroy - new_rails_conductor_inbound_email_source GET /rails/conductor/action_mailbox/inbound_emails/sources/new(.:format) rails/conductor/action_mailbox/inbound_emails/sources#new - rails_conductor_inbound_email_sources POST /rails/conductor/action_mailbox/inbound_emails/sources(.:format) rails/conductor/action_mailbox/inbound_emails/sources#create - rails_conductor_inbound_email_reroute POST /rails/conductor/action_mailbox/:inbound_email_id/reroute(.:format) rails/conductor/action_mailbox/reroutes#create - rails_service_blob GET /rails/active_storage/blobs/redirect/:signed_id/*filename(.:format) active_storage/blobs/redirect#show - rails_service_blob_proxy GET /rails/active_storage/blobs/proxy/:signed_id/*filename(.:format) active_storage/blobs/proxy#show - GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs/redirect#show - rails_blob_representation GET /rails/active_storage/representations/redirect/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/redirect#show - rails_blob_representation_proxy GET /rails/active_storage/representations/proxy/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/proxy#show - GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/redirect#show - rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show - update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update - rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create - MESSAGE - end - - test "`rake routes` outputs a deprecation warning" do - add_to_env_config("development", "config.active_support.deprecation = :stderr") - - stderr = capture(:stderr) { run_rake_routes } - assert_match(/DEPRECATION WARNING: Using `bin\/rake routes` is deprecated and will be removed in Rails 6.1/, stderr) - end - - private - def run_rake_routes - Dir.chdir(app_path) { `bin/rake routes` } - end - end - end -end