[Catalyst-commits] r13306 - in
Catalyst-Runtime/5.80/branches/private-action-attributes: .
lib/Catalyst t/aggregate t/lib/TestApp/Controller/Action
ajgb at dev.catalyst.perl.org
ajgb at dev.catalyst.perl.org
Mon May 24 09:58:27 GMT 2010
Author: ajgb
Date: 2010-05-24 10:58:27 +0100 (Mon, 24 May 2010)
New Revision: 13306
Modified:
Catalyst-Runtime/5.80/branches/private-action-attributes/Changes
Catalyst-Runtime/5.80/branches/private-action-attributes/lib/Catalyst/Controller.pm
Catalyst-Runtime/5.80/branches/private-action-attributes/t/aggregate/live_component_controller_action_action.t
Catalyst-Runtime/5.80/branches/private-action-attributes/t/lib/TestApp/Controller/Action/Action.pm
Log:
fix RT#57780
Modified: Catalyst-Runtime/5.80/branches/private-action-attributes/Changes
===================================================================
--- Catalyst-Runtime/5.80/branches/private-action-attributes/Changes 2010-05-24 09:56:22 UTC (rev 13305)
+++ Catalyst-Runtime/5.80/branches/private-action-attributes/Changes 2010-05-24 09:58:27 UTC (rev 13306)
@@ -3,6 +3,7 @@
Bug fixes:
- Fix the --mech and --mechanize options to the myapp_create.pl script
to operate correctly by fixing the options passed down into the script.
+ - Fix setting actions attributes with '*' [RT#57780]
Documentation:
- Fix missing - in the docs when describing the --mechanize option at one
Modified: Catalyst-Runtime/5.80/branches/private-action-attributes/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/private-action-attributes/lib/Catalyst/Controller.pm 2010-05-24 09:56:22 UTC (rev 13305)
+++ Catalyst-Runtime/5.80/branches/private-action-attributes/lib/Catalyst/Controller.pm 2010-05-24 09:58:27 UTC (rev 13306)
@@ -198,7 +198,7 @@
. $_
. '" is not available from controller '
. ( ref $self ) )
- } keys %{ $self->_controller_actions }
+ } grep { $_ ne '*' } keys %{ $self->_controller_actions }
) if ( ref $self );
return uniq @methods;
}
@@ -319,6 +319,13 @@
}
}
+ # ignore atrributes defined by config->( action => { '*' => ... } )
+ # for Private methods
+ if ( $final_attributes{Private} && exists $actions->{'*'} ) {
+ return { Private => $final_attributes{Private} };
+ }
+
+
return \%final_attributes;
}
Modified: Catalyst-Runtime/5.80/branches/private-action-attributes/t/aggregate/live_component_controller_action_action.t
===================================================================
--- Catalyst-Runtime/5.80/branches/private-action-attributes/t/aggregate/live_component_controller_action_action.t 2010-05-24 09:56:22 UTC (rev 13305)
+++ Catalyst-Runtime/5.80/branches/private-action-attributes/t/aggregate/live_component_controller_action_action.t 2010-05-24 09:58:27 UTC (rev 13306)
@@ -166,6 +166,27 @@
'Content is a serialized Catalyst::Request'
);
}
+
+ {
+ ok( my $response = request('http://localhost/action_action_eight'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action_action_eight', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Action',
+ 'Test Class'
+ );
+ is( $response->header('X-TestExtraArgsAction'), '42,23', 'Extra args get passed to action contstructor' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
+
}
done_testing;
Modified: Catalyst-Runtime/5.80/branches/private-action-attributes/t/lib/TestApp/Controller/Action/Action.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/private-action-attributes/t/lib/TestApp/Controller/Action/Action.pm 2010-05-24 09:56:22 UTC (rev 13305)
+++ Catalyst-Runtime/5.80/branches/private-action-attributes/t/lib/TestApp/Controller/Action/Action.pm 2010-05-24 09:58:27 UTC (rev 13306)
@@ -5,11 +5,13 @@
__PACKAGE__->config(
actions => {
+ '*' => { Global => 1 },
action_action_five => { ActionClass => '+Catalyst::Action::TestBefore' },
},
action_args => {
'*' => { extra_arg => 42 },
action_action_seven => { another_extra_arg => 23 },
+ action_action_eight => { another_extra_arg => 23 },
},
);
@@ -51,4 +53,10 @@
$c->forward('TestApp::View::Dump::Request');
}
+sub action_action_eight : ActionClass('~TestExtraArgsAction') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+
1;
More information about the Catalyst-commits
mailing list