Change generated application skeleton to use Moose
Tomas Doran [Sat, 5 Sep 2009 15:15:37 +0000 (15:15 +0000)]
share/Makefile.PL.tt
share/lib/MyApp.pm.tt
share/lib/MyApp/Controller/Root.pm.tt

index a4cfabb..383fc97 100644 (file)
@@ -10,7 +10,8 @@ requires 'Catalyst::Runtime' => '[% catalyst_version %]';
 requires 'Catalyst::Plugin::ConfigLoader';
 requires 'Catalyst::Plugin::Static::Simple';
 requires 'Catalyst::Action::RenderView';
-requires 'parent';
+requires 'Moose';
+requires 'namespace::autoclean';
 requires 'Config::General'; # This should reflect the config file format you've chosen
                  # See Catalyst::Plugin::ConfigLoader for supported formats
 catalyst;
index cb2a7b7..0032a13 100644 (file)
@@ -1,7 +1,6 @@
 package [% name %];
-
-use strict;
-use warnings;
+use Moose;
+use namespace::autoclean;
 
 use Catalyst::Runtime 5.80;
 
@@ -13,10 +12,12 @@ use Catalyst::Runtime 5.80;
 # Static::Simple: will serve static files from the application's root
 #                 directory
 
-use parent qw/Catalyst/;
 use Catalyst qw/-Debug
                 ConfigLoader
                 Static::Simple/;
+
+extends 'Catalyst';
+
 our $VERSION = '0.01';
 
 # Configure the application.
index edd875f..f3cc272 100644 (file)
@@ -1,8 +1,8 @@
 package [% rootname %];
+use Moose;
+use namespace::autoclean;
 
-use strict;
-use warnings;
-use parent 'Catalyst::Controller';
+BEGIN { extends 'Catalyst::Controller' }
 
 #
 # Sets the actions in this controller to be registered with no prefix
@@ -58,4 +58,4 @@ it under the same terms as Perl itself.
 
 =cut
 
-1;
+__PACKAGE__->meta->make_immutable;