mirror of https://github.com/rails/rails
Removed deprecated router API from railties
This commit is contained in:
parent
7c50454529
commit
e6b93fa6db
|
@ -399,17 +399,6 @@ module Rails
|
|||
end
|
||||
end
|
||||
|
||||
# DEPRECATED: Remove in 3.1
|
||||
initializer :add_routing_namespaces do |app|
|
||||
paths.app.controllers.to_a.each do |load_path|
|
||||
load_path = File.expand_path(load_path)
|
||||
Dir["#{load_path}/*/**/*_controller.rb"].collect do |path|
|
||||
namespace = File.dirname(path).sub(/#{Regexp.escape(load_path)}\/?/, '')
|
||||
app.routes.controller_namespaces << namespace unless namespace.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# I18n load paths are a special case since the ones added
|
||||
# later have higher priority.
|
||||
initializer :add_locales do
|
||||
|
|
|
@ -74,7 +74,7 @@ en:
|
|||
YAML
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match '/i18n', :to => lambda { |env| [200, {}, [I18n.t(:foo)]] }
|
||||
end
|
||||
RUBY
|
||||
|
@ -147,4 +147,4 @@ en:
|
|||
assert_fallbacks :ca => [:ca, :"es-ES", :es, :'en-US', :en]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -70,7 +70,7 @@ class LoadingTest < Test::Unit::TestCase
|
|||
MODEL
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match '/load', :to => lambda { |env| [200, {}, Post.all] }
|
||||
match '/unload', :to => lambda { |env| [200, {}, []] }
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ module ApplicationTests
|
|||
RUBY
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match ':controller(/:action)'
|
||||
end
|
||||
RUBY
|
||||
|
@ -91,7 +91,7 @@ module ApplicationTests
|
|||
RUBY
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match ':controller(/:action)'
|
||||
end
|
||||
RUBY
|
||||
|
@ -102,7 +102,7 @@ module ApplicationTests
|
|||
|
||||
test "mount rack app" do
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
mount lambda { |env| [200, {}, [env["PATH_INFO"]]] }, :at => "/blog"
|
||||
# The line below is required because mount sometimes
|
||||
# fails when a resource route is added.
|
||||
|
@ -132,7 +132,7 @@ module ApplicationTests
|
|||
RUBY
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match ':controller(/:action)'
|
||||
end
|
||||
RUBY
|
||||
|
@ -164,7 +164,7 @@ module ApplicationTests
|
|||
RUBY
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match 'admin/foo', :to => 'admin/foo#index'
|
||||
match 'foo', :to => 'foo#index'
|
||||
end
|
||||
|
@ -192,7 +192,7 @@ module ApplicationTests
|
|||
RUBY
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match 'foo', :to => 'foo#bar'
|
||||
end
|
||||
RUBY
|
||||
|
@ -223,7 +223,7 @@ module ApplicationTests
|
|||
end
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match 'foo', :to => ::InitializeRackApp
|
||||
end
|
||||
RUBY
|
||||
|
@ -240,7 +240,7 @@ module ApplicationTests
|
|||
RUBY
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
resources :yazilar
|
||||
end
|
||||
RUBY
|
||||
|
|
|
@ -14,7 +14,7 @@ module ApplicationTests
|
|||
@plugin = engine "blog"
|
||||
|
||||
app_file 'config/routes.rb', <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match "/engine_route" => "application_generating#engine_route"
|
||||
match "/engine_route_in_view" => "application_generating#engine_route_in_view"
|
||||
match "/url_for_engine_route" => "application_generating#url_for_engine_route"
|
||||
|
|
|
@ -178,7 +178,7 @@ module RailtiesTest
|
|||
RUBY
|
||||
|
||||
app_file "config/routes.rb", <<-RUBY
|
||||
AppTemplate::Application.routes.draw do |map|
|
||||
AppTemplate::Application.routes.draw do
|
||||
match 'foo', :to => 'foo#index'
|
||||
end
|
||||
RUBY
|
||||
|
@ -192,7 +192,7 @@ module RailtiesTest
|
|||
RUBY
|
||||
|
||||
@plugin.write "config/routes.rb", <<-RUBY
|
||||
Rails.application.routes.draw do |map|
|
||||
Rails.application.routes.draw do
|
||||
match 'foo', :to => 'bar#index'
|
||||
match 'bar', :to => 'bar#index'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue