RenderView should now work with isa. (thanks to all reporters!)
- documented 'isa' action class option (experimental!)
- fixed bug where setup wasn't called without plugins
+ - fixed bug where under block scope wasn't cleaned up
[0.008] Tue Aug 18 19:59:57 CEST 2009
- default_inner now ignores arguments
use constant STOP_PARSING => '__MXDECLARE_STOP_PARSING__';
use constant UNDER_VAR => '$CatalystX::Declare::SCOPE::UNDER';
+ use constant UNDER_STACK => '@CatalystX::Declare::SCOPE::UNDER_STACK';
use aliased 'CatalystX::Declare::Action::CatchValidationError';
use aliased 'MooseX::Method::Signatures::Meta::Method';
if ($ctx->peek_next_char eq '{' and $self->identifier eq 'under') {
$ctx->inject_if_block(
- sprintf '%s; local %s; BEGIN { %s = qq(%s) };',
- $ctx->scope_injector_call,
+ sprintf '%s; BEGIN { push %s, %s; %s = qq(%s) };',
+ $ctx->scope_injector_call(
+ sprintf ';BEGIN { %s = pop %s };',
+ UNDER_VAR,
+ UNDER_STACK,
+ ),
+ UNDER_STACK,
UNDER_VAR,
UNDER_VAR,
$target,
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More;
+use Catalyst::Test 'TestApp';
+
+is get('/under_seq/foo'), 'foo', 'basic action';
+is get('/under_seq/bar/test_bar'), 'bar', 'first action in under scope';
+is get('/under_seq/baz/test_baz'), 'baz', 'following base and under scope';
+
+done_testing;
+
+
--- /dev/null
+use CatalystX::Declare;
+
+controller TestApp::Controller::UnderSequence {
+
+ action base under '/' as 'under_seq';
+
+ under base {
+
+ final action foo { $ctx->response->body('foo') }
+
+ action bar;
+
+ under bar { final action test_bar { $ctx->response->body('bar') } }
+
+ action baz;
+
+ under baz { final action test_baz { $ctx->response->body('baz') } }
+ }
+}