[cgiapp] Patches available for ::Plugin::Routes (was: Re: New
plugin idea based/inspired on CA Dispatch)
mark at summersault.com
Mon Sep 22 23:02:18 EDT 2008
> I already did the change you suggested to change "routes_table" to
> with this one.
> - Consider having "routes_table()" automatically add every run mode
> dispatched to
> the "run_modes" hash, if a subroutine with that name exists in the current
> scope. (I suppose you can use the "can()" method to test for that? ).
> Maybe because I'm not pro-efficient with perl enough, or maybe I'm
> missing something?
I've sent you patches via github that implement this for you now. You
can browse them here:
When registering routes, we also try to automatically register the run
mode names. We will register a run mode when there is not already one
defined with the target name and we 'can' call a method with the same
This means that for you common cases when you call 'routes', you can
skip calling run_modes().
My other patches improved your 'import' routine, created proper
automated tests, and made sure Data::Dumper was only loaded if it was
> Also,. I liked this:
> Perhaps there should be an option to set a path for which all the routes are
> relative to. For example:
> I definitely going to include that change.
> But, about the catalyst style, I didn't liked the approach, and, also,
> see something (I think almost) exactly like that in
> and I really didn't liked it (or just didn't worked for me).
I had forgetten about that. I never used it myself. I think I prefer the
approach in this new plugin.
A bit of further feedback:
- Your POD coverage test is still failing.
More information about the cgiapp