Skip to content

Commit

Permalink
Remove references to ActionDispatch::Routing::Routes in favor of Rail…
Browse files Browse the repository at this point in the history
…s.appication.routes.
  • Loading branch information
Carl Lerche committed Feb 24, 2010
1 parent 60ca754 commit ba57575
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,5 +1,5 @@
path File.dirname(__FILE__) path File.dirname(__FILE__)
source 'http://gemcutter.org' source 'http://rubygems.org'


gem "rails", "3.0.0.beta1" gem "rails", "3.0.0.beta1"


Expand Down
2 changes: 1 addition & 1 deletion 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" match '/rails/info/properties' => "rails/info#properties"
end end
4 changes: 2 additions & 2 deletions 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.' 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
Rails::Application.reload_routes! 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| 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 reqs = route.requirements.empty? ? "" : route.requirements.inspect
{:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs} {:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
end end
Expand Down
2 changes: 1 addition & 1 deletion railties/test/rails_info_controller_test.rb
Expand Up @@ -14,7 +14,7 @@ class InfoControllerTest < ActionController::TestCase
tests Rails::InfoController tests Rails::InfoController


def setup def setup
ActionDispatch::Routing::Routes.draw do |map| Rails.application.routes.draw do |map|
match ':controller/:action' match ':controller/:action'
end end
@controller.stubs(:consider_all_requests_local? => false, :local_request? => true) @controller.stubs(:consider_all_requests_local? => false, :local_request? => true)
Expand Down
6 changes: 3 additions & 3 deletions railties/test/railties/shared_tests.rb
Expand Up @@ -133,7 +133,7 @@ def self.call(env)
end end
end end
ActionDispatch::Routing::Routes.draw do Rails.application.routes.draw do
match "/sprokkit", :to => Sprokkit match "/sprokkit", :to => Sprokkit
end end
RUBY RUBY
Expand Down Expand Up @@ -170,7 +170,7 @@ def index
RUBY RUBY


@plugin.write "config/routes.rb", <<-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 'foo', :to => 'bar#index'
match 'bar', :to => 'bar#index' match 'bar', :to => 'bar#index'
end end
Expand Down Expand Up @@ -261,7 +261,7 @@ def self.call(env)


def test_namespaced_controllers_with_namespaced_routes def test_namespaced_controllers_with_namespaced_routes
@plugin.write "config/routes.rb", <<-RUBY @plugin.write "config/routes.rb", <<-RUBY
ActionDispatch::Routing::Routes.draw do Rails.application.routes.draw do
namespace :admin do namespace :admin do
match "index", :to => "admin/foo#index" match "index", :to => "admin/foo#index"
end end
Expand Down

0 comments on commit ba57575

Please sign in to comment.