aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks/routes.rake
diff options
context:
space:
mode:
authorBenoit Tigeot <benoit@hopsandfork.com>2018-02-26 22:10:12 +0100
committerBenoit Tigeot <benoit@hopsandfork.com>2018-02-27 15:22:38 +0100
commita2748eda586b11db59e2d0f59ab37910156d6c32 (patch)
tree3e6a74c969d899dd6a2636ec305ffad83d9df80f /railties/lib/rails/tasks/routes.rake
parent87de79e9cc25fe6ac02095a1d0c014941a39ede8 (diff)
downloadrails-a2748eda586b11db59e2d0f59ab37910156d6c32.tar.gz
rails-a2748eda586b11db59e2d0f59ab37910156d6c32.tar.bz2
rails-a2748eda586b11db59e2d0f59ab37910156d6c32.zip
Move rake routes task to rails command
After a discussion with matthewd. It was mentioned that rake tasks need to be moved to rails command. See: https://github.com/rails/rails/issues/32117
Diffstat (limited to 'railties/lib/rails/tasks/routes.rake')
-rw-r--r--railties/lib/rails/tasks/routes.rake31
1 files changed, 0 insertions, 31 deletions
diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake
deleted file mode 100644
index 403286d280..0000000000
--- a/railties/lib/rails/tasks/routes.rake
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-require "optparse"
-
-desc "Print out all defined routes in match order, with names. Target specific controller with -c option, or grep routes using -g option"
-task routes: :environment do
- all_routes = Rails.application.routes.routes
- require "action_dispatch/routing/inspector"
- inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
-
- routes_filter = nil
-
- OptionParser.new do |opts|
- opts.banner = "Usage: rails routes [options]"
-
- Rake.application.standard_rake_options.each { |args| opts.on(*args) }
-
- opts.on("-c CONTROLLER") do |controller|
- routes_filter = { controller: controller }
- end
-
- opts.on("-g PATTERN") do |pattern|
- routes_filter = pattern
- end
-
- end.parse!(ARGV.reject { |x| x == "routes" })
-
- puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, routes_filter)
-
- exit 0 # ensure extra arguments aren't interpreted as Rake tasks
-end