mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rename RouteInspect to RoutesInspector for consistency
This commit is contained in:
parent
e39f218b7b
commit
dbc43bcce6
4 changed files with 7 additions and 7 deletions
|
@ -62,7 +62,7 @@ module Rails
|
||||||
##
|
##
|
||||||
# This class is just used for displaying route information when someone
|
# This class is just used for displaying route information when someone
|
||||||
# executes `rake routes`. People should not use this class.
|
# executes `rake routes`. People should not use this class.
|
||||||
class RouteInspector # :nodoc:
|
class RoutesInspector # :nodoc:
|
||||||
def initialize
|
def initialize
|
||||||
@engines = Hash.new
|
@engines = Hash.new
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
require 'rails/application/route_inspector'
|
require 'rails/application/routes_inspector'
|
||||||
|
|
||||||
class Rails::InfoController < ActionController::Base
|
class Rails::InfoController < ActionController::Base
|
||||||
self.view_paths = File.join(File.dirname(__FILE__), 'templates')
|
self.view_paths = File.join(File.dirname(__FILE__), 'templates')
|
||||||
|
@ -15,7 +15,7 @@ class Rails::InfoController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def routes
|
def routes
|
||||||
inspector = Rails::Application::RouteInspector.new
|
inspector = Rails::Application::RoutesInspector.new
|
||||||
@info = inspector.format(_routes.routes).join("\n")
|
@info = inspector.format(_routes.routes).join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
||||||
task :routes => :environment do
|
task :routes => :environment do
|
||||||
all_routes = Rails.application.routes.routes
|
all_routes = Rails.application.routes.routes
|
||||||
require 'rails/application/route_inspector'
|
require 'rails/application/routes_inspector'
|
||||||
inspector = Rails::Application::RouteInspector.new
|
inspector = Rails::Application::RoutesInspector.new
|
||||||
puts inspector.format(all_routes, ENV['CONTROLLER']).join "\n"
|
puts inspector.format(all_routes, ENV['CONTROLLER']).join "\n"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
require 'minitest/autorun'
|
require 'minitest/autorun'
|
||||||
require 'rails/application/route_inspector'
|
require 'rails/application/routes_inspector'
|
||||||
require 'action_controller'
|
require 'action_controller'
|
||||||
require 'rails/engine'
|
require 'rails/engine'
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ module ApplicationTests
|
||||||
class RouteInspectTest < ActiveSupport::TestCase
|
class RouteInspectTest < ActiveSupport::TestCase
|
||||||
def setup
|
def setup
|
||||||
@set = ActionDispatch::Routing::RouteSet.new
|
@set = ActionDispatch::Routing::RouteSet.new
|
||||||
@inspector = Rails::Application::RouteInspector.new
|
@inspector = Rails::Application::RoutesInspector.new
|
||||||
app = ActiveSupport::OrderedOptions.new
|
app = ActiveSupport::OrderedOptions.new
|
||||||
app.config = ActiveSupport::OrderedOptions.new
|
app.config = ActiveSupport::OrderedOptions.new
|
||||||
app.config.assets = ActiveSupport::OrderedOptions.new
|
app.config.assets = ActiveSupport::OrderedOptions.new
|
Loading…
Reference in a new issue