[Nitro] Param stuff (yes, I'm sorry ^^;)

Jonathan Buch john at oxyliquit.de
Sat Oct 28 10:01:52 EDT 2006


>> I'm really sorry, but could you either revert back to the original partial
>> broken param handling or test with my testcase properly without randomly
>> commenting valid testcases (which are not touching the two issues I raised
>> in my last post about params)? ^^;
>> With `def action(par = nil)` broken we can't release on the 31st. ^^;
> I havent randomly remarked your tests. I just haven worked on this
> issue yet. It is in my immediate todo list. Btw, if you can make a
> patch of your implementation against the current repo, it would be
> really helpful. Just this single patch, it is too difficult to
> understand your changes in that biiiig bundle you have sent me some
> time ago.
> thanks in advance and sorry for the inconvienience,

yes, randomly was indeed the wrong word here.

Attached are 2 patches which do what I was proposing (probably).
This time it should even work with routes..

Sat Oct 28 15:21:40 CEST 2006  Jonathan Buch <john at oxyliquit.de>
   * Rework parameter handling
   Quite big change on how parameters are handled.

   * Use new context.action_params instead of .query_params to distinguish
     between GET params and the ones from nice urls.
   * When route is given merge the route parameters into the GET params,
     add route parameter values into .action_params.
   * Change Router#decode_route to use Dictionary instead of Hash (to
     preserve order, important for action arguments).
   * action raises `ActionError, "Wrong parameter count"` on wrong usage.
   * Uncommented testcases in tc_controller_params again
   * Added testcase for routes (TODO: need more of those)
   * Single line fix for tc_dispatcher, it still used NoActionError.

Sat Oct 28 15:48:33 CEST 2006  Jonathan Buch <john at oxyliquit.de>
   * Bugfix for params and actions with arity 0
   Since the same params are used for rendering included parts and the
   /error page, actions with arity 0 have to be treated differently.

The current implementation is probably not as fast as it could be, but
we can optimize this later I guess.
I have to admit that I hate digging into this Nitro code...  I feel much
more at home with Og.  ^^;


Feel the love
-------------- next part --------------
A non-text attachment was scrubbed...
Name: params.patch.tar.bz2
Type: application/bzip2
Size: 13952 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20061028/8b67a727/attachment-0001.bin 

More information about the Nitro-general mailing list