diff --git a/Gemfile b/Gemfile index 3756e2987e0ffd82088806db2c6f22910393b8bc..928222e2d0b0d5ba97e5435415ca554d5c3775c7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ path File.dirname(__FILE__) -source 'http://gemcutter.org' +source 'http://rubygems.org' gem "rails", "3.0.0.beta1" diff --git a/railties/builtin/routes.rb b/railties/builtin/routes.rb index b4fdb95a646c20d9ebb31742c267196e42075469..bd58034d8fbdfadaab8ecc25a1154d5f3c0f405f 100644 --- a/railties/builtin/routes.rb +++ b/railties/builtin/routes.rb @@ -1,3 +1,3 @@ -ActionDispatch::Routing::Routes.draw do |map| +Rails.application.routes.draw do |map| match '/rails/info/properties' => "rails/info#properties" end diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake index 1d0ac38c96066cf16bfa0b70cf68eda71912161e..42e01d5e5143ace3225bd39ab5eb2fbad0d61582 100644 --- a/railties/lib/rails/tasks/routes.rake +++ b/railties/lib/rails/tasks/routes.rake @@ -1,9 +1,9 @@ desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.' task :routes => :environment do Rails::Application.reload_routes! - all_routes = ENV['CONTROLLER'] ? ActionDispatch::Routing::Routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : ActionDispatch::Routing::Routes.routes + all_routes = ENV['CONTROLLER'] ? Rails.application.routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : Rails.application.routes.routes routes = all_routes.collect do |route| - name = ActionDispatch::Routing::Routes.named_routes.routes.index(route).to_s + name = Rails.application.routes.named_routes.routes.index(route).to_s reqs = route.requirements.empty? ? "" : route.requirements.inspect {:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs} end diff --git a/railties/test/rails_info_controller_test.rb b/railties/test/rails_info_controller_test.rb index 9cfa1d6aaa0136e2f24b99038c50d41ebbb5e0b6..a6fc23d95b5c229ea2b553f3cc461c2bde18221c 100644 --- a/railties/test/rails_info_controller_test.rb +++ b/railties/test/rails_info_controller_test.rb @@ -14,7 +14,7 @@ class InfoControllerTest < ActionController::TestCase tests Rails::InfoController def setup - ActionDispatch::Routing::Routes.draw do |map| + Rails.application.routes.draw do |map| match ':controller/:action' end @controller.stubs(:consider_all_requests_local? => false, :local_request? => true) diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb index c9e6e6081a4a57f080c7010913d0b3055fa01060..151abe21f8c909bf667e3dec4d0fe9991d7094fd 100644 --- a/railties/test/railties/shared_tests.rb +++ b/railties/test/railties/shared_tests.rb @@ -133,7 +133,7 @@ def self.call(env) end end - ActionDispatch::Routing::Routes.draw do + Rails.application.routes.draw do match "/sprokkit", :to => Sprokkit end RUBY @@ -170,7 +170,7 @@ def index RUBY @plugin.write "config/routes.rb", <<-RUBY - ActionDispatch::Routing::Routes.draw do |map| + Rails.application.routes.draw do |map| match 'foo', :to => 'bar#index' match 'bar', :to => 'bar#index' end @@ -261,7 +261,7 @@ def self.call(env) def test_namespaced_controllers_with_namespaced_routes @plugin.write "config/routes.rb", <<-RUBY - ActionDispatch::Routing::Routes.draw do + Rails.application.routes.draw do namespace :admin do match "index", :to => "admin/foo#index" end