Strip code down to the bare minimum to start from
t0m [Wed, 22 Apr 2009 21:36:00 +0000 (22:36 +0100)]
Makefile.PL
lib/DynamicAppDemo.pm
lib/DynamicAppDemo/Controller/Root.pm

index 5041e0d..a242a27 100644 (file)
@@ -5,13 +5,10 @@ use inc::Module::Install;
 name 'DynamicAppDemo';
 all_from 'lib/DynamicAppDemo.pm';
 
-requires 'Catalyst::Runtime' => '5.80001';
+requires 'Catalyst::Runtime' => '5.80002';
 requires 'Catalyst::Plugin::ConfigLoader';
-requires 'Catalyst::Plugin::Static::Simple';
-requires 'Catalyst::Action::RenderView';
-requires 'parent';
-requires 'Config::General'; # This should reflect the config file format you've chosen
-                 # See Catalyst::Plugin::ConfigLoader for supported formats
+requires 'YAML';
+
 catalyst;
 
 install_script glob('script/*.pl');
index 82da51d..a1714f4 100644 (file)
@@ -1,64 +1,19 @@
 package DynamicAppDemo;
+use Moose;
+use Catalyst::Runtime '5.80002';
 
-use strict;
-use warnings;
+use Catalyst qw/
+    -Debug
+    ConfigLoader
+/;
 
-use Catalyst::Runtime '5.70';
+extends 'Catalyst';
 
-# Set flags and add plugins for the application
-#
-#         -Debug: activates the debug mode for very useful log messages
-#   ConfigLoader: will load the configuration from a Config::General file in the
-#                 application's home directory
-# Static::Simple: will serve static files from the application's root
-#                 directory
-
-use parent qw/Catalyst/;
-use Catalyst qw/-Debug
-                ConfigLoader
-                Static::Simple/;
 our $VERSION = '0.01';
 
-# Configure the application.
-#
-# Note that settings in dynamicappdemo.conf (or other external
-# configuration file that you set up manually) take precedence
-# over this when using ConfigLoader. Thus configuration
-# details given here can function as a default configuration,
-# with an external configuration file acting as an override for
-# local deployment.
-
 __PACKAGE__->config( name => 'DynamicAppDemo' );
 
-# Start the application
 __PACKAGE__->setup();
 
+__PACKAGE__->meta->make_immutable;
 
-=head1 NAME
-
-DynamicAppDemo - Catalyst based application
-
-=head1 SYNOPSIS
-
-    script/dynamicappdemo_server.pl
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 SEE ALSO
-
-L<DynamicAppDemo::Controller::Root>, L<Catalyst>
-
-=head1 AUTHOR
-
-Tomas Doran,,,,
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
-1;
index 1bb1714..c6b0831 100644 (file)
@@ -1,61 +1,14 @@
 package DynamicAppDemo::Controller::Root;
+use Moose;
 
-use strict;
-use warnings;
-use parent 'Catalyst::Controller';
+# Note - need old style actions
+# Note - do not extend general controller base class, which messes with
+#        action registration!
+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
-
-DynamicAppDemo::Controller::Root - Root Controller for DynamicAppDemo
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 METHODS
-
-=cut
-
-=head2 index
-
-=cut
-
-sub index :Path :Args(0) {
-    my ( $self, $c ) = @_;
-
-    # Hello World
-    $c->response->body( $c->welcome_message );
-}
-
-sub default :Path {
-    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
-
-Tomas Doran,,,,
-
-=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;