The following is a message sent to DHH regarding the upcoming Routing patch. Routes are the new, classier name for Directions. Directors were the native Ruby rewriting from a while ago. This patch is available as a separate svn branch on the Rails server. You should be able to check out the complete repository using svn co http://dev.rubyonrails.org/svn/rails/branches/routing What''s so good about Routes? No more reliance upon mod_rewrite allows Rails to run on basically any webserver, most notably lighttpd. However, Routes are not only a Ruby native method for matching the standard Rails URLs; Routes allow you to specify custom URL styles and have them ''just work.'' Standard url helpers such as link_to and url_for are automagically aware of custom routes and will use them in an only slightly surprising manner. I should note that this patch is not yet finished -- it resides in it''s own branch for a reason. As of yet, very few unit tests have been written, and most testing has been done with Webrick + (wget || Firefox). That said, everything I''ve checked is working. If you''re interested, please download the patched branch and give it a spin. (If you do so, please note the required addition to environment.rb below.) If you''re ambitious, try writing some tests for it. I''ll be in IRC''s #rubyonrails channel tomorrow (Feb 08), so feel free to drop by and ask any questions you may have. If you''d prefer email, my Inbox is always open to you. Cheers, Nicholas ---------- Forwarded Message ---------- Subject: Routes & Module Progress Date: Tuesday 08 February 2005 01:18 From: Nicholas Seckar <nseckar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: David Hansson <david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org> Cc: rails-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org The routes branch now has true module support. The controller/module tree starts with the root Controllers module, which is (for now,) created by a line in environment.rb: Controllers = Object::Dependencies::LoadingModule.new File.expand_path(File.join(RAILS_ROOT, ''app'', ''controllers'')) The default routes.rb file now contains the line ''map.use_default_routes,'' which adds a RailsRoute instance to the list of routes. (RailsRoute class is the subclass of Route which generates and recognizes standard rails-style urls.) Since we''re not using LoadingModule for Models, I might remove the generalizations and move it to action_controller/dependencies.rb; currently it resides in activesupport/lib/dependencies.rb. As it is, the LoadModule is not truly generalized, although that could be changed by touching 4 lines. The module tree loads missing names as they are required. Currently it deletes all modules and controllers after each request -- see the relavent line in dispatcher.rb. This should be changed to only be performed when in :load mode. I''m not sure what conflicts will occur with respect to the current Dependencies setup. You''ll probably be able to think of a few things that need to be changed. I''m not at all sure as to what happens with respect to nested controllers and their helpers and views. I have done some basic testing with webrick and so far everything I''ve tried has worked fine. I''ve added todo items asking for further testing of these areas. I started a book on manuals.ror, but didn''t get to far. I plan to write the complete documentation for Routes there. I''ve got a few assignments due over the next couple of days. (And by that I mean 3 in the next 48 hours =) I''ll be trying to write tests in between them. Even if I can''t code that much, I''ll make sure to be on IRC so I can answer any questions that crop up. If you can encourage people to try the patch out, and maybe even code some tests, it would be greatly appreciated. I''ve committed all my changes to the routes branch. Feel free to work on the tada list if you get a chance. See you tomorrow! ------------------------------------------------------- -- Nicholas Seckar aka. Ulysses
Is there any documentation (RDoc or otherwise) that describes how this is going to be used? I''ve seen the soapBX presentation on the topic, but I get the feeling that that''s fairly old with relation to this patch. Brian On Tue, 8 Feb 2005 09:39:06 -0500, Nicholas Seckar <nseckar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > The following is a message sent to DHH regarding the upcoming Routing patch. > Routes are the new, classier name for Directions. Directors were the native > Ruby rewriting from a while ago. > > This patch is available as a separate svn branch on the Rails server. You > should be able to check out the complete repository using > > svn co http://dev.rubyonrails.org/svn/rails/branches/routing > > What''s so good about Routes? No more reliance upon mod_rewrite allows Rails to > run on basically any webserver, most notably lighttpd. > > However, Routes are not only a Ruby native method for matching the standard > Rails URLs; Routes allow you to specify custom URL styles and have them ''just > work.'' Standard url helpers such as link_to and url_for are automagically > aware of custom routes and will use them in an only slightly surprising > manner. > > I should note that this patch is not yet finished -- it resides in it''s own > branch for a reason. As of yet, very few unit tests have been written, and > most testing has been done with Webrick + (wget || Firefox). That said, > everything I''ve checked is working. > > If you''re interested, please download the patched branch and give it a spin. > (If you do so, please note the required addition to environment.rb below.) If > you''re ambitious, try writing some tests for it. > > I''ll be in IRC''s #rubyonrails channel tomorrow (Feb 08), so feel free to drop > by and ask any questions you may have. If you''d prefer email, my Inbox is > always open to you. > > Cheers, Nicholas > > ---------- Forwarded Message ---------- > > Subject: Routes & Module Progress > Date: Tuesday 08 February 2005 01:18 > From: Nicholas Seckar <nseckar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > To: David Hansson <david-OiTZALl8rpK0mm7Ywyx6yg@public.gmane.org> > Cc: rails-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org > > The routes branch now has true module support. The controller/module tree > starts with the root Controllers module, which is (for now,) created by a > line in environment.rb: > > Controllers = Object::Dependencies::LoadingModule.new > File.expand_path(File.join(RAILS_ROOT, ''app'', ''controllers'')) > > The default routes.rb file now contains the line ''map.use_default_routes,'' > which adds a RailsRoute instance to the list of routes. (RailsRoute class is > the subclass of Route which generates and recognizes standard rails-style > urls.) > > Since we''re not using LoadingModule for Models, I might remove the > generalizations and move it to action_controller/dependencies.rb; currently > it resides in activesupport/lib/dependencies.rb. As it is, the LoadModule is > not truly generalized, although that could be changed by touching 4 lines. > > The module tree loads missing names as they are required. Currently it > deletes all modules and controllers after each request -- see the relavent > line in dispatcher.rb. This should be changed to only be performed when in > :load mode. > > I''m not sure what conflicts will occur with respect to the current > Dependencies setup. You''ll probably be able to think of a few things that > need to be changed. I''m not at all sure as to what happens with respect to > nested controllers and their helpers and views. I have done some basic > testing with webrick and so far everything I''ve tried has worked fine. I''ve > added todo items asking for further testing of these areas. > > I started a book on manuals.ror, but didn''t get to far. I plan to write the > complete documentation for Routes there. > > I''ve got a few assignments due over the next couple of days. (And by that I > mean 3 in the next 48 hours =) I''ll be trying to write tests in between them. > Even if I can''t code that much, I''ll make sure to be on IRC so I can answer > any questions that crop up. If you can encourage people to try the patch > out, and maybe even code some tests, it would be greatly appreciated. > > I''ve committed all my changes to the routes branch. Feel free to work on the > tada list if you get a chance. > > See you tomorrow! > > ------------------------------------------------------- > > -- > > Nicholas Seckar aka. Ulysses > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- The years ahead pick up their dark bags. They move closer. There''s a slight rise in the silence then nothing. -- (If you''re receiving this in response to mail sent to bluczkie-OM76b2Iv3yLQjUSlxSEPGw@public.gmane.org, don''t be concerned This is my new address, but mail will be forwarded here indefinitely)
On Tuesday 08 February 2005 10:16, Brian L. wrote:> Is there any documentation (RDoc or otherwise) that describes how this > is going to be used? I''ve seen the soapBX presentation on the topic, > but I get the feeling that that''s fairly old with relation to this > patch.At the moment I haven''t written any formal documentation. Rest assured that there will be comprehensive documentation when the time comes. The current branch is somewhat similar to the patch that was discussed on the soapBX presentation, however there are major differences. * The old patch and the current branch do not share any source. * Although the new branch doesn''t support regular-expressions, or named captures as the old patch did, it is still quite powerful. * The present branch will be much easier to integrate into your site. The shape of your site can be redefined by making changes to your config/routes.rb file. Url helpers such as url_for and link_to will not require any hand-holding, as they will automatically (there, are you happy htonl? :P) become aware of your custom routes. * The branch also introduces a clean implementation of controller modules. Clean in both the sense ''brand new'', and in the sense ''pure.'' Controllers are now loaded into true Ruby Module objects. * The new branch has vastly superior class, module, and method names. Consider: ''Routes'' vs. ''Directors.'' ''Directors.on_url'' vs. ''map.connect,'' or even ''Directions'' vs. ''Routing''. -- Nicholas Seckar aka. Ulysses