Tool for tsting routes

Is there a tool or code fragment tat can be used with irb via
scripts/console to test toutes/

Sort of
    Prompt for input
    responds with the route

Thanks

Is there a tool or code fragment tat can be used with irb via
scripts/console to test toutes/

Sort of
    Prompt for input
    responds with the route

Thanks

One way is to start an inner irb session on ActionController::Routing::Routes

$ script/console
Loading development environment (Rails 2.0.1)

irb ActionController::Routing::Routes
recognize_path("/")

=> {:controller=>"people", :action=>"index"}

recognize_path("/login")

=> {:controller=>"session", :action=>"new"}

generate(:controller=>"people", :action => "index")

=> "/people"

This should work with Rails 1.2.x as well as Rails 2.0.x

Rails 2.0.x also has a rake task to list the routes:

  $rake routes