prepared for release, dropping version number from Catalyst-Helper
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index a6a36e0..2611628 100644 (file)
@@ -6,8 +6,9 @@ use base 'Class::Accessor::Fast';
 use Config;
 use File::Spec;
 use File::Path;
-use IO::File;
 use FindBin;
+use IO::File;
+use POSIX 'strftime';
 use Template;
 use Catalyst::Devel;
 use Catalyst::Utils;
@@ -15,7 +16,6 @@ use Catalyst::Exception;
 
 my %cache;
 
-our $VERSION = '1.00';
 
 =head1 NAME
 
@@ -27,7 +27,7 @@ See L<Catalyst::Manual::Intro>
 
 =head1 DESCRIPTION
 
-Bootstrap a Catalyst application. Autogenerates scripts
+Bootstrap a Catalyst application. Autogenerates scripts.
 
 =head2 METHODS
 
@@ -387,7 +387,7 @@ sub _mk_readme {
 sub _mk_changes {
     my $self = shift;
     my $dir  = $self->{dir};
-    my $time = localtime time;
+    my $time = strftime('%Y-%m-%d %T', localtime time);
     $self->render_file( 'changes', "$dir\/Changes", { time => $time } );
 }
 
@@ -549,7 +549,6 @@ use warnings;
 
 use Catalyst::Runtime '5.70';
 
-#
 # Set flags and add plugins for the application
 #
 #         -Debug: activates the debug mode for very useful log messages
@@ -557,29 +556,25 @@ use Catalyst::Runtime '5.70';
 #                 application's home directory
 # Static::Simple: will serve static files from the application's root 
 #                 directory
-#
+
 use Catalyst qw/-Debug ConfigLoader Static::Simple/;
 
 our $VERSION = '0.01';
 
-#
 # Configure the application. 
 #
-# Note that settings in [% name %].yml take precedence over
-# this when using ConfigLoader. Thus configuration details
-# given here can function as a default configuration, with a
-# YAML file acting as an override for local deployment.
-#
+# Note that settings in [% name %].yml (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 a external configuration file acting as an override for
+# local deployment.
+
 __PACKAGE__->config( name => '[% name %]' );
 
-#
 # Start the application
-#
 __PACKAGE__->setup;
 
-#
-# IMPORTANT: Please look into [% rootname %] for more
-#
 
 =head1 NAME
 
@@ -591,7 +586,7 @@ __PACKAGE__->setup;
 
 =head1 DESCRIPTION
 
-Catalyst based application.
+[enter your description here]
 
 =head1 SEE ALSO
 
@@ -624,15 +619,11 @@ __PACKAGE__->config->{namespace} = '';
 
 =head1 NAME
 
-[% rootname %] - Root Controller for this Catalyst based application
-
-=head1 SYNOPSIS
-
-See L<[% name %]>.
+[% rootname %] - Root Controller for [% name %]
 
 =head1 DESCRIPTION
 
-Root Controller for this Catalyst based application.
+[enter your description here]
 
 =head1 METHODS
 
@@ -642,9 +633,6 @@ Root Controller for this Catalyst based application.
 
 =cut
 
-#
-# Output a friendly welcome message
-#
 sub default : Private {
     my ( $self, $c ) = @_;
 
@@ -652,19 +640,13 @@ sub default : Private {
     $c->response->body( $c->welcome_message );
 }
 
-#
-# Uncomment and modify this end action after adding a View component
-#
-#=head2 end
-#
-#=cut
-#
-#sub end : Private {
-#    my ( $self, $c ) = @_;
-#
-#    # Forward to View unless response body is already defined
-#    $c->forward( $c->view('') ) unless $c->response->body;
-#}
+=head2 end
+
+Attempt to render a view, if needed.
+
+=cut 
+
+sub end : ActionClass('RenderView') {}
 
 =head1 AUTHOR
 
@@ -684,9 +666,12 @@ use inc::Module::Install;
 name '[% dir %]';
 all_from '[% path %]';
 
-requires Catalyst => '[% catalyst_version %]';
-requires YAML; # This should reflect the config file format you've chosen
-               # See Catalyst::Plugin::ConfigLoader for supported formats
+requires 'Catalyst' => '[% catalyst_version %]';
+requires 'Catalyst::Plugin::ConfigLoader';
+requires 'Catalyst::Plugin::Static::Simple';
+requires 'Catalyst::Action::RenderView';
+requires 'YAML'; # This should reflect the config file format you've chosen
+                 # See Catalyst::Plugin::ConfigLoader for supported formats
 catalyst;
 
 install_script glob('script/*.pl');
@@ -755,7 +740,7 @@ See L<Catalyst::Manual>
 
 =head1 DESCRIPTION
 
-Run a Catalyst application as cgi.
+Run a Catalyst application as a cgi script.
 
 =head1 AUTHOR
 
@@ -763,7 +748,6 @@ Sebastian Riedel, C<sri@oook.de>
 
 =head1 COPYRIGHT
 
-Copyright 2004 Sebastian Riedel. All rights reserved.
 
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
@@ -838,11 +822,10 @@ Run a Catalyst application as fastcgi.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@oook.de>
+Maintained by the Catalyst Core Team.
 
 =head1 COPYRIGHT
 
-Copyright 2004 Sebastian Riedel. All rights reserved.
-
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
@@ -929,7 +912,7 @@ require [% name %];
       -host           host (defaults to all)
    -p -port           port (defaults to 3000)
    -k -keepalive      enable keep-alive connections
-   -r -restart        restart when files got modified
+   -r -restart        restart when files get modified
                       (defaults to false)
    -rd -restartdelay  delay between file checks
    -rr -restartregex  regex match files that trigger
@@ -950,11 +933,10 @@ Run a Catalyst Testserver for this application.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@oook.de>
+Maintained by the Catalyst Core Team.
 
 =head1 COPYRIGHT
 
-Copyright 2004 Sebastian Riedel. All rights reserved.
-
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
@@ -1006,11 +988,10 @@ Run a Catalyst action from the command line.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@oook.de>
+Maintained by the Catalyst Core Team.
 
 =head1 COPYRIGHT
 
-Copyright 2004 Sebastian Riedel. All rights reserved.
-
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
@@ -1062,8 +1043,10 @@ pod2usage(1) unless $helper->mk_component( '[% name %]', @ARGV );
    [% appprefix %]_create.pl view MyView TT
    [% appprefix %]_create.pl view TT TT
    [% appprefix %]_create.pl model My::Model
-   [% appprefix %]_create.pl model SomeDB DBIC::SchemaLoader dbi:SQLite:/tmp/my.db
-   [% appprefix %]_create.pl model AnotherDB DBIC::SchemaLoader dbi:Pg:dbname=foo root 4321
+   [% appprefix %]_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
+   dbi:SQLite:/tmp/my.db
+   [% appprefix %]_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
+   dbi:Pg:dbname=foo root 4321
 
  See also:
    perldoc Catalyst::Manual
@@ -1080,11 +1063,10 @@ This behavior can be suppressed with the C<-force> option.
 =head1 AUTHOR
 
 Sebastian Riedel, C<sri@oook.de>
+Maintained by the Catalyst Core Team.
 
 =head1 COPYRIGHT
 
-Copyright 2004 Sebastian Riedel. All rights reserved.
-
 This library is free software, you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
@@ -1100,10 +1082,6 @@ use base 'Catalyst::[% long_type %]';
 
 [% class %] - Catalyst [% long_type %]
 
-=head1 SYNOPSIS
-
-See L<[% app %]>
-
 =head1 DESCRIPTION
 
 Catalyst [% long_type %].
@@ -1112,19 +1090,16 @@ Catalyst [% long_type %].
 
 =cut
 
-#
-# Uncomment and modify this or add new actions to fit your needs
-#
-#=head2 default
-#
-#=cut
-#
-#sub default : Private {
-#    my ( $self, $c ) = @_;
-#
-#    # Hello World
-#    $c->response->body('[% class %] is on Catalyst!');
-#}
+
+=head2 index 
+
+=cut
+
+sub index : Private {
+    my ( $self, $c ) = @_;
+
+    $c->response->body('Matched [% class %] in [%name%].');
+}
 
 [% END %]
 =head1 AUTHOR