[Catalyst-commits] r13533 - in Catalyst-Runtime/5.80/branches/gsoc_breadboard: . lib lib/Catalyst lib/Catalyst/Script t/aggregate t/lib t/lib/ChainedActionsApp t/lib/ChainedActionsApp/Controller

arcanez at dev.catalyst.perl.org arcanez at dev.catalyst.perl.org
Wed Aug 25 22:12:38 GMT 2010


Author: arcanez
Date: 2010-08-25 23:12:38 +0100 (Wed, 25 Aug 2010)
New Revision: 13533

Added:
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/aggregate/unit_dispatcher_chained_action.t
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp.pm
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp/
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp/Controller/
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp/Controller/Root.pm
Modified:
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/Changes
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/Makefile.PL
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/Script/Server.pm
   Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/ScriptRole.pm
Log:
 r1900 at warpedreality (orig r13513):  dduncan | 2010-08-21 20:25:42 -0700
 C-R-5-8 : Makefile.PL : remove bogus comment
 r1901 at warpedreality (orig r13514):  ferz | 2010-08-22 07:03:36 -0700
 Discovered some inconsistency in precedence behavior of chained actions.
 
 r1902 at warpedreality (orig r13515):  ferz | 2010-08-22 08:04:58 -0700
 Checks for any action now.
 
 r1903 at warpedreality (orig r13516):  bricas | 2010-08-23 10:55:43 -0700
 Fix two warnings:
  - Fix warning about "excludes" during role application
  - Fix warning from MooseX::Getopt regarding duplicate "help" aliases
 
 r1904 at warpedreality (orig r13520):  hobbs | 2010-08-24 18:31:50 -0700
 Add the app for ChainedActionsApp test. It's still failing, but differently now...
 
 r1908 at warpedreality (orig r13528):  t0m | 2010-08-25 06:46:22 -0700
 Fix bug with parse_on_demand
 r1909 at warpedreality (orig r13529):  t0m | 2010-08-25 06:47:01 -0700
 Back out 13528, cocked that up.
 r1910 at warpedreality (orig r13530):  t0m | 2010-08-25 06:47:23 -0700
 Fix bug with parse_on_demand (take 2)



Property changes on: Catalyst-Runtime/5.80/branches/gsoc_breadboard
___________________________________________________________________
Modified: svk:merge
   - 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/aggregate_more:11803
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/better_scripts:12074
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_iis_cgi:13450
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_path_info_decoding:12089
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_request_uri:13262
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/more_metaclass_compat:13280
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/param_filtering:13012
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/rt58057:13445
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/tweak_controller_action_creation:13440
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_encode_captures_andor_args_take2:11811
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_for_utf8:12834
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:13470
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-mech_tests:15583
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
   + 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/aggregate_more:11803
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/better_scripts:12074
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_iis_cgi:13450
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_path_info_decoding:12089
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_request_uri:13262
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/more_metaclass_compat:13280
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/param_filtering:13012
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/rt58057:13445
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/tweak_controller_action_creation:13440
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_encode_captures_andor_args_take2:11811
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_for_utf8:12834
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:13530
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-mech_tests:15583
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442

Modified: Catalyst-Runtime/5.80/branches/gsoc_breadboard/Changes
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/Changes	2010-08-25 17:44:06 UTC (rev 13532)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/Changes	2010-08-25 22:12:38 UTC (rev 13533)
@@ -1,5 +1,12 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+ Bug fixes:
+  - parse_on_demand fixed when used in conjunction with debug mode.
+    A regression was introduced in 5.80022 which would cause the body
+    to always be parsed for logging at the end of the request when in
+    debug mode. This has been fixed so that if the body has not been parsed
+    by the time the request is logged, then the body is omitted.
+
 5.80025 2010-07-29 01:50:00
 
  New features:
@@ -14,6 +21,8 @@
   - Fix controllers with no method attributes (where the action definitions
     are entirely contained in config). RT#58057
   - Fix running as a CGI under IIS at non-root locations.
+  - Fix warning about "excludes" during role application
+  - Fix warning from MooseX::Getopt regarding duplicate "help" aliases
 
  Documentation:
   - Fix missing - in the docs when describing the --mechanize option at one

Modified: Catalyst-Runtime/5.80/branches/gsoc_breadboard/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/Makefile.PL	2010-08-25 17:44:06 UTC (rev 13532)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/Makefile.PL	2010-08-25 22:12:38 UTC (rev 13533)
@@ -46,7 +46,7 @@
 requires 'Task::Weaken';
 requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
 requires 'MRO::Compat';
-requires 'MooseX::Getopt' => '0.25';
+requires 'MooseX::Getopt' => '0.30';
 requires 'MooseX::Types';
 requires 'MooseX::Types::Common::Numeric';
 requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
@@ -65,7 +65,7 @@
         grep { $_ ne 't/aggregate.t' }
         map  { glob } qw[t/*.t t/aggregate/*.t];
 }
-author_requires 'CatalystX::LeakChecker', '0.05'; # Skipped if this isn't installed
+author_requires 'CatalystX::LeakChecker', '0.05';
 author_requires 'File::Copy::Recursive'; # For http server test
 
 author_tests 't/author';

Modified: Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/Script/Server.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/Script/Server.pm	2010-08-25 17:44:06 UTC (rev 13532)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/Script/Server.pm	2010-08-25 22:12:38 UTC (rev 13533)
@@ -13,8 +13,6 @@
 
 with 'Catalyst::ScriptRole';
 
-__PACKAGE__->meta->get_attribute('help')->cmd_aliases('?');
-
 has debug => (
     traits        => [qw(Getopt)],
     cmd_aliases   => 'd',

Modified: Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/ScriptRole.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/ScriptRole.pm	2010-08-25 17:44:06 UTC (rev 13532)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst/ScriptRole.pm	2010-08-25 22:12:38 UTC (rev 13533)
@@ -6,7 +6,7 @@
 use namespace::autoclean;
 
 with 'MooseX::Getopt' => {
-    excludes => [qw/
+    -excludes => [qw/
         _getopt_spec_warnings
         _getopt_spec_exception
         _getopt_full_usage
@@ -20,14 +20,6 @@
     required => 1,
 );
 
-has help => (
-    traits        => ['Getopt'],
-    isa           => Bool,
-    is            => 'ro',
-    documentation => 'Display this help and exit',
-    cmd_aliases   => ['?', 'h'],
-);
-
 sub _getopt_spec_exception {}
 
 sub _getopt_spec_warnings {
@@ -41,11 +33,6 @@
     exit 0;
 }
 
-before run => sub {
-    my $self = shift;
-    $self->_getopt_full_usage if $self->help;
-};
-
 sub run {
     my $self = shift;
     $self->_run_application;

Modified: Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm	2010-08-25 17:44:06 UTC (rev 13532)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm	2010-08-25 22:12:38 UTC (rev 13533)
@@ -2150,7 +2150,7 @@
         $c->log->debug("Query keywords are: $keywords");
     }
 
-    $c->log_request_parameters( query => $request->query_parameters, body => $request->body_parameters );
+    $c->log_request_parameters( query => $request->query_parameters, $request->_has_body ? (body => $request->body_parameters) : () );
 
     $c->log_request_uploads($request);
 }

Added: Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/aggregate/unit_dispatcher_chained_action.t
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/aggregate/unit_dispatcher_chained_action.t	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/aggregate/unit_dispatcher_chained_action.t	2010-08-25 22:12:38 UTC (rev 13533)
@@ -0,0 +1,120 @@
+# Test case for Chained Actions
+
+use strict;
+use warnings;
+use FindBin qw/$Bin/;
+use lib "$Bin/../lib";
+use Catalyst::Test 'ChainedActionsApp';
+use Test::More tests => 7;
+
+content_like('/', qr/Application Home Page/, 'Application home');
+content_like('/15/GoldFinger', qr/List project GoldFinger pages/, 'GoldFinger Project Index');
+content_like('/15/GoldFinger/4/007', qr/This is 007 page of GoldFinger project/, '007 page in GoldFinger Project');
+content_like('/account', qr/New account o login/, 'no account');
+content_like('/account/ferz', qr/This is account ferz/, 'account');
+content_like('/account/123', qr/This is account 123/, 'account');
+action_notfound('/c');
+
+1;
+
+__END__
+
+(12:32:59) ferz: t0m: I've fixed but /*/* still gets precedence on /account/*
+(12:33:46) ferz: /*/* is defined in Root.pm controller while /account/* is defined in Account.pm controller
+(12:34:35) shadowpaste: "ferz" at 217.168.150.38 pasted "[debug] Loaded Chained actions" (29 lines) at http://paste.scsys.co.uk/48847
+
+[debug] Loaded Chained actions:
+.-------------------------------------+--------------------------------------.
+| Path Spec                           | Private                              |
++-------------------------------------+--------------------------------------+
+| /account/*                          | /setup (0)                           |
+|                                     | -> /account/account_base (0)         |
+|                                     | => /account/account                  |
+| /account                            | /setup (0)                           |
+|                                     | => /account/no_account               |
+| /...                                | /setup (0)                           |
+|                                     | => /default                          |
+| /                                   | /setup (0)                           |
+|                                     | => /home                             |
+| /*/*/*/*                            | /setup (0)                           |
+|                                     | -> /home_base (2)                    |
+|                                     | => /hpage                            |
+| /*/*                                | /setup (0)                           |
+|                                     | -> /home_base (2)                    |
+|                                     | => /hpages                           |
+.----------------------------------------------------------------------------.
+
+(12:36:24) ferz: how can I change the precedence between them?
+(12:37:26) mst: um. /account/* should definitely beat /*/*
+(12:37:38) mst: ah
+(12:37:43) mst: hang on
+(12:37:57) ferz: I'm here, I don't escape
+(12:37:59) mst: use CaptureArgs(1) in account_base and make account Args(0)
+
+(12:40:03) ferz: mst: so CaputeArgs(0) is deprecated when endpoints need at least one argument
+(12:40:29) mst: wtf?
+(12:40:52) mst: ferz: current code please.
+(12:45:18) ferz: mst: I'd understood from man and book that CapturedArgs(0) was valid for midpoints and Args( 1,2,...) for endpoints. You have just suggested me a fix to make CaptureArgs(1) instead for midpoint and Args(0) for endpoint, probably I've misunderstood it from man.
+(12:45:43) mst: ferz: please just show me the current code you have
+(12:45:53) mst: it's going to be easier to use that as an example to explain this
+(12:47:20) shadowpaste: "ferz" at 217.168.150.38 pasted "These are action defined in Ro" (94 lines) at http://paste.scsys.co.uk/48848
+(12:48:19) mst: ferz: ok, so.
+(12:48:36) mst: sub account : Chained('/account/account_base') PathPart('') CaptureArgs(1) {
+(12:48:37) mst: then
+(12:48:41) ferz: mst: I'm fixing as you suggested
+(12:48:48) mst: sub account_view :Chained('account') :PathPart('') :Args(0)
+(12:50:22) mst: ferz: the point is that CaptureArgs is part of the Chained feature set
+(12:50:30) mst: ferz: but Args is part of the general catalyst dispacther features
+(12:50:43) mst: ferz: so the Chained precendence logic only works for CaptureArgs
+(12:53:38) ferz: mst: I understand, but there is something still wrong even if I use CaptureArgs(1) on account_base, I will show you the new code and chained action table.
+(12:59:04) shadowpaste: "ferz" at 217.168.150.38 pasted "/account/123 still execute hpage() instead of account()" (65 lines) at http://paste.scsys.co.uk/48850
+(13:00:32) ferz: http://paste.scsys.co.uk/48851 from catalyst console
+(13:01:06) mst: debug output on startup?
+(13:02:36) ferz: ok
+(13:03:57) shadowpaste: "ferz" at 217.168.150.38 pasted "[debug] Debug messages enabled" (73 lines) at http://paste.scsys.co.uk/48852
+(13:04:40) ferz: mst: I've seen that I can upgrade to latest version, I'll report debug after catalyst update
+(13:12:35) mst: ferz: that should bloody well work.
+(13:16:49) ferz: it doesn't   
+(13:17:17) mst: I just don't get it.
+(13:17:37) mst: since I wrote the bit of the code that should make this work, and I can still see it in the source.
+(13:18:36) mst: ferz: can you delete all the other chains and see if that fixes it?
+(13:18:44) mst: since if it doesn't what's left should make a catalyst test :)
+(13:56:30) ferz: ok mst
+(14:07:36) ferz: I've simplified it more but it still fails, I prepare the catalyst test
+(14:08:46) mst: ok, can I see the simplified version please?
+(14:08:52) mst: I want to double check I've not missed anything
+(14:09:19) ferz: ok, I've place everything in the Root.pm controller
+(14:12:28) mst: ferz: show :)
+(14:12:28) shadowpaste: "ferz" at 217.168.150.38 pasted "Everything in Root.pm controller" (97 lines) at http://paste.scsys.co.uk/48856
+(14:13:21) mst: ferz: kill the hpage action
+(14:13:24) mst: and the default
+(14:13:29) mst: and 'home'
+(14:13:33) ferz: ok
+(14:15:33) ferz: done, it fails yet
+(14:15:49) mst: ok. show me code and startup debug please.
+(14:15:54) ferz: ok
+(14:17:38) shadowpaste: "ferz" at 217.168.150.38 pasted "> perl script/test_chained_ser" (136 lines) at http://paste.scsys.co.uk/48857
+(14:18:29) mst: and /account/1 still fires hpages?
+(14:18:50) ferz: yes, it is
+(14:19:44) mst: ok. comment out the hpages stuff and let's check that /account/* works without /*/* there
+(14:20:50) ferz: without hpage() it works fine
+(14:22:06) mst: could you try one more thing
+(14:22:18) mst: split account_base into two actions
+(14:22:32) mst: so the non-'' PathPart and the non-zero CaptureArgs are separate
+(14:23:59) ferz: Here there is output of previous tests http://paste.scsys.co.uk/48858  now I try splitting it as you suggest.
+(14:26:45) ferz: mst I don't understand you last suggestion: split account_base in two actions, two midpoints?
+(14:27:16) ferz: s/you/your/
+(14:27:21) mst: yes.
+(14:29:33) ferz: sub first_account_base : Chained('setup) PathPart('account') CaptureArgs(0) and the other sub second_account_base Chained('first_account_base') Path('') Args(1) ?
+(14:29:49) mst: CaptureArgs(1)
+(14:29:57) ferz: yes, ok
+(14:30:00) mst: and then chain account off second_account_base
+(14:30:05) ferz: sure
+(14:33:06) shadowpaste: "ferz" at 217.168.150.38 pasted "> perl script/test_chained_ser" (65 lines) at http://paste.scsys.co.uk/48859
+(14:33:35) mst: ok, thought so.
+(14:34:34) ferz: mst: I fear about my mistake on something about home_base or hpage()
+(14:36:04) mst: ferz: well if that's the case we're both wrong.
+(14:36:10) ferz: s/hpage/hpages/
+(14:36:49) ferz: since they are both on same controller I try still to invert their order in source
+(14:37:29) ferz: but the result is the same
+(14:38:42) mst: yeah

Added: Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp/Controller/Root.pm	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp/Controller/Root.pm	2010-08-25 22:12:38 UTC (rev 13533)
@@ -0,0 +1,112 @@
+package ChainedActionsApp::Controller::Root;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+#
+# Sets the actions in this controller to be registered with no prefix
+# so they function identically to actions created in MyApp.pm
+#
+__PACKAGE__->config(namespace => '');
+
+=head1 NAME
+
+test_chained::Controller::Root - Root Controller for test_chained
+
+=head1 DESCRIPTION
+
+[enter your description here]
+
+=head1 METHODS
+
+=head2 setup
+
+This is the C<setup> method that initializes the request. Any matching action
+will go through this, so it is an application-wide automatically executed
+action. For more information, see L<Catalyst::DispatchType::Chained>
+
+=cut
+
+sub setup : Chained('/') PathPart('') CaptureArgs(0) {
+    my ( $self, $c ) = @_;
+    # Common things here are to check for ACL and setup global contexts
+}
+
+sub home : Chained('setup') PathPart('') Args(0) {
+    my($self,$c) = @_;
+    $c->response->body( "Application Home Page" );
+}
+
+=head2 home_base
+
+     Args:
+       project_id
+       project_title
+
+=cut
+
+sub home_base : Chained('setup') PathPart('') CaptureArgs(2) {
+    my($self,$c,$proj_id,$title) = @_;
+    $c->stash({project_id=>$proj_id, project_title=>$title});
+}
+
+sub hpages : Chained('home_base') PathPart('') Args(0) {
+    my($self,$c) = @_;
+    $c->response->body( "List project " . $c->stash->{project_title} . " pages");
+}
+
+sub hpage : Chained('home_base') PathPart('') Args(2) {
+    my($self,$c,$page_id, $pagetitle) = @_;
+    $c->response->body( "This is $pagetitle page of " . $c->stash->{project_title} . " project" );
+}
+
+sub no_account : Chained('setup') PathPart('account') Args(0) {
+    my($self,$c) = @_;
+    $c->response->body( "New account o login" );
+}
+
+sub account_base : Chained('setup') PathPart('account') CaptureArgs(1) {
+    my($self,$c,$acc_id) = @_;
+    $c->stash({account_id=>$acc_id});
+}
+
+sub account : Chained('account_base') PathPart('') Args(0) {
+    my($self,$c,$acc) = @_;
+    $c->response->body( "This is account " . $c->stash->{account_id} );
+}
+
+=head2 default
+
+Standard 404 error page
+
+=cut
+
+sub default : Chained('setup') PathPart('') Args() {
+    my ( $self, $c ) = @_;
+    $c->response->body( 'Page not found' );
+    $c->response->status(404);
+}
+
+=head2 end
+
+Attempt to render a view, if needed.
+
+=cut
+
+sub end : ActionClass('RenderView') {}
+
+=head1 AUTHOR
+
+Ferruccio Zamuner
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;
+
+1;

Added: Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp.pm	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/t/lib/ChainedActionsApp.pm	2010-08-25 22:12:38 UTC (rev 13533)
@@ -0,0 +1,21 @@
+package ChainedActionsApp;
+use Moose;
+use namespace::autoclean;
+
+use Catalyst::Runtime 5.80;
+
+use Catalyst qw//;
+
+extends 'Catalyst';
+
+our $VERSION = "0.01";
+$VERSION = eval $VERSION;
+
+__PACKAGE__->config(
+  name => 'ChainedActionsApp',
+  disable_component_regex_fallback => 1,
+);
+
+__PACKAGE__->setup;
+
+1;




More information about the Catalyst-commits mailing list