Switch everything to autoclean. Add sanity tests to ensure appropriate modern perl...
[catagits/CatalystX-DynamicComponent.git] / lib / DynamicAppDemo / ControllerBase.pm
CommitLineData
d9d2e65d 1package DynamicAppDemo::ControllerBase;
2use Moose;
b14364e6 3use Moose::Util qw/find_meta/;
046d763d 4use namespace::autoclean;
d9d2e65d 5
db979186 6# You need attributes still for _DISPATCH and friends.
d9d2e65d 7BEGIN { extends 'Catalyst::Controller' }
8
b14364e6 9around get_action_methods => sub {
10 my $orig = shift;
11 my $self = shift;
12
13 my $meta = find_meta($self);
14
15 # FIXME - fugly, and nasty
16 return (
17 ( map {
18 my $m = $meta->get_method($_);
19 # EPIC CHEAT to just smash the attribute definition :)
20 $m->meta->get_attribute('attributes')->set_value($m, ['Local']);
21 $m;
22 }
23 grep { ! /^(_|new|meta)/ }
24 $meta->get_method_list
25 ),
26 (
27 $self->$orig(@_)
28 )
29 );
30};
31
d9d2e65d 32__PACKAGE__->meta->make_immutable;
33