Back out - what the hell was the unexpected hunk. I fail at today.
[catagits/Catalyst-Devel.git] / lib / Catalyst / Helper.pm
index 835c061..8ab9ad2 100644 (file)
@@ -16,24 +16,13 @@ use Catalyst::Exception;
 
 my %cache;
 
-
 =head1 NAME
 
 Catalyst::Helper - Bootstrap a Catalyst application
 
 =head1 SYNOPSIS
 
-See L<Catalyst::Manual::Intro>
-
-=head1 DESCRIPTION
-
-Bootstrap a Catalyst application. Autogenerates scripts.
-
-=head2 METHODS
-
-=head3 get_file
-
-Slurp file from DATA.
+  catalyst.pl <myappname>
 
 =cut
 
@@ -53,19 +42,13 @@ sub get_file {
     return 0;
 }
 
-=head3 mk_app
-
-Create the main application skeleton.
-
-=cut
-
 sub mk_app {
     my ( $self, $name ) = @_;
 
     # Needs to be here for PAR
     require Catalyst;
 
-    if ( $name =~ /[^\w\:]/ ) {
+    if ( $name =~ /[^\w:]/ || $name =~ /^\d/ || $name =~ /\b:\b|:{3,}/) {
         warn "Error: Invalid application name.\n";
         return 0;
     }
@@ -75,7 +58,9 @@ sub mk_app {
     $self->{script          } = File::Spec->catdir( $self->{dir}, 'script' );
     $self->{appprefix       } = Catalyst::Utils::appprefix($name);
     $self->{appenv          } = Catalyst::Utils::class2env($name);
-    $self->{startperl       } = "#!$Config{perlpath} -w";
+    $self->{startperl       } = -r '/usr/bin/env'
+                                ? '#!/usr/bin/env perl'
+                                : "#!$Config{perlpath} -w";
     $self->{scriptgen       } = $Catalyst::Devel::CATALYST_SCRIPT_GEN || 4;
     $self->{catalyst_version} = $Catalyst::VERSION;
     $self->{author          } = $self->{author} = $ENV{'AUTHOR'}
@@ -106,17 +91,11 @@ sub mk_app {
         $self->_mk_server;
         $self->_mk_test;
         $self->_mk_create;
+        $self->_mk_information;
     }
     return $self->{dir};
 }
 
-=head3 mk_component
-
-This method is called by create.pl to make new components
-for your application.
-
-=cut
-
 sub mk_component {
     my $self = shift;
     my $app  = shift;
@@ -145,7 +124,7 @@ sub mk_component {
         my $name   = shift || "Missing name for model/view/controller";
         my $helper = shift;
         my @args   = @_;
-        return 0 if $name =~ /[^\w\:]/;
+       return 0 if $name =~ /[^\w\:]/;
         $type              = lc $type;
         $self->{long_type} = ucfirst $type;
         $type              = 'M' if $type =~ /model/i;
@@ -207,12 +186,6 @@ sub mk_component {
     return 1;
 }
 
-=head3 mk_dir
-
-Surprisingly, this function makes a directory.
-
-=cut
-
 sub mk_dir {
     my ( $self, $dir ) = @_;
     if ( -d $dir ) {
@@ -227,12 +200,6 @@ sub mk_dir {
     Catalyst::Exception->throw( message => qq/Couldn't create "$dir", "$!"/ );
 }
 
-=head3 mk_file
-
-writes content to a file.
-
-=cut
-
 sub mk_file {
     my ( $self, $file, $content ) = @_;
     if ( -e $file ) {
@@ -259,10 +226,6 @@ sub mk_file {
     Catalyst::Exception->throw( message => qq/Couldn't create "$file", "$!"/ );
 }
 
-=head3 next_test
-
-=cut
-
 sub next_test {
     my ( $self, $tname ) = @_;
     if ($tname) { $tname = "$tname.t" }
@@ -283,13 +246,6 @@ sub next_test {
     return File::Spec->catfile( $dir, "$type\_$tname" );
 }
 
-=head3 render_file
-
-Render and create a file from a template in DATA using 
-Template Toolkit.
-
-=cut
-
 sub render_file {
     my ( $self, $file, $path, $vars ) = @_;
     $vars ||= {};
@@ -303,6 +259,11 @@ sub render_file {
     $self->mk_file( $path, $output );
 }
 
+sub _mk_information {
+    my $self = shift;
+    print qq/Change to application directory and Run "perl Makefile.PL" to make sure your install is complete\n/;
+}
+
 sub _mk_dirs {
     my $self = shift;
     $self->mk_dir( $self->{dir} );
@@ -376,7 +337,7 @@ sub _mk_config {
     my $dir       = $self->{dir};
     my $appprefix = $self->{appprefix};
     $self->render_file( 'config',
-        File::Spec->catfile( $dir, "$appprefix.yml" ) );
+        File::Spec->catfile( $dir, "$appprefix.conf" ) );
 }
 
 sub _mk_readme {
@@ -496,19 +457,58 @@ sub _deprecate_file {
     }
 }
 
+=head1 DESCRIPTION
+
+This module is used by B<catalyst.pl> to create a set of scripts for a
+new catalyst application. The scripts each contain documentation and
+will output help on how to use them if called incorrectly or in some
+cases, with no arguments.
+
+It also provides some useful methods for a Helper module to call when
+creating a component. See L</METHODS>.
+
+=head1 SCRIPTS
+
+=head2 _create.pl
+
+Used to create new components for a catalyst application at the
+development stage.
+
+=head2 _server.pl
+
+The catalyst test server, starts an HTTPD which outputs debugging to
+the terminal.
+
+=head2 _test.pl
+
+A script for running tests from the command-line.
+
+=head2 _cgi.pl
+
+Run your application as a CGI.
+
+=head2 _fastcgi.pl
+
+Run the application as a fastcgi app. Either by hand, or call this
+from FastCgiServer in your http server config.
+
 =head1 HELPERS
 
+The L</_create.pl> script creates application components using Helper
+modules. The Catalyst team provides a good number of Helper modules
+for you to use. You can also add your own.
+
 Helpers are classes that provide two methods.
 
     * mk_compclass - creates the Component class
     * mk_comptest  - creates the Component test
 
-So when you call C<bin/create view MyView TT>, create would try to execute
-Catalyst::Helper::View::TT->mk_compclass and
+So when you call C<scripts/myapp_create.pl view MyView TT>, create
+will try to execute Catalyst::Helper::View::TT->mk_compclass and
 Catalyst::Helper::View::TT->mk_comptest.
 
-See L<Catalyst::Helper::View::TT> and L<Catalyst::Helper::Model::DBIC> for
-examples.
+See L<Catalyst::Helper::View::TT> and
+L<Catalyst::Helper::Model::DBIC::Schema> for examples.
 
 All helper classes should be under one of the following namespaces.
 
@@ -516,6 +516,106 @@ All helper classes should be under one of the following namespaces.
     Catalyst::Helper::View::
     Catalyst::Helper::Controller::
 
+=head2 COMMON HELPERS
+
+=over
+
+=item *
+
+L<Catalyst::Helper::Model::DBIC::Schema> - DBIx::Class models
+
+=item *
+
+L<Catalyst::Helper::View::TT> - Template Toolkit view
+
+=item *
+
+L<Catalyst::Helper::Model::LDAP>
+
+=item *
+
+L<Catalyst::Helper::Model::Adaptor> - wrap any class into a Catalyst model
+
+=back
+
+=head3 NOTE
+
+The helpers will read author name from /etc/passwd by default. + To override, please export the AUTHOR variable.
+
+=head1 METHODS
+
+=head2 mk_compclass
+
+This method in your Helper module is called with C<$helper>
+which is a L<Catalyst::Helper> object, and whichever other arguments
+the user added to the command-line. You can use the $helper to call methods
+described below.
+
+If the Helper module does not contain a C<mk_compclass> method, it
+will fall back to calling L</render_file>, with an argument of
+C<compclass>.
+
+=head2 mk_comptest
+
+This method in your Helper module is called with C<$helper>
+which is a L<Catalyst::Helper> object, and whichever other arguments
+the user added to the command-line. You can use the $helper to call methods
+described below.
+
+If the Helper module does not contain a C<mk_compclass> method, it
+will fall back to calling L</render_file>, with an argument of
+C<comptest>.
+
+=head2 mk_stuff
+
+This method is called if the user does not supply any of the usual
+component types C<view>, C<controller>, C<model>. It is passed the
+C<$helper> object (an instance of L<Catalyst::Helper>), and any other
+arguments the user typed.
+
+There is no fallback for this method.
+
+=head1 INTERNAL METHODS
+
+These are the methods that the Helper classes can call on the
+<$helper> object passed to them.
+
+=head2 render_file ($file, $path, $vars)
+
+Render and create a file from a template in DATA using Template
+Toolkit. $file is the relevent chunk of the __DATA__ section, $path is
+the path to the file and $vars is the hashref as expected by
+L<Template Toolkit|Template>.
+
+=head2 get_file ($class, $file)
+
+Fetch file contents from the DATA section. This is used internally by
+L</render_file>.  $class is the name of the class to get the DATA
+section from.  __PACKAGE__ or ( caller(0) )[0] might be sensible
+values for this.
+
+=head2 mk_app
+
+Create the main application skeleton. This is called by L<catalyst.pl>.
+
+=head2 mk_component ($app)
+
+This method is called by L<create.pl> to make new components
+for your application.
+
+=head3 mk_dir ($path)
+
+Surprisingly, this function makes a directory.
+
+=head2 mk_file ($file, $content)
+
+Writes content to a file. Called by L</render_file>.
+
+=head2 next_test ($test_name)
+
+Calculates the name of the next numbered test file and returns it.
+Don't give the number or the .t suffix for the test name.
+
 =head1 NOTE
 
 The helpers will read author name from /etc/passwd by default.
@@ -526,13 +626,13 @@ To override, please export the AUTHOR variable.
 L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
 L<Catalyst::Response>, L<Catalyst>
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 LICENSE
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =begin pod_to_ignore
@@ -548,33 +648,35 @@ package [% name %];
 use strict;
 use warnings;
 
-use Catalyst::Runtime '5.70';
+use Catalyst::Runtime 5.80;
 
 # 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 YAML file in the
+#   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 
+# Static::Simple: will serve static files from the application's root
 #                 directory
 
-use Catalyst qw/-Debug ConfigLoader Static::Simple/;
-
+use parent qw/Catalyst/;
+use Catalyst qw/-Debug
+                ConfigLoader
+                Static::Simple/;
 our $VERSION = '0.01';
 
-# Configure the application. 
+# Configure the application.
 #
-# Note that settings in [% appprefix %].yml (or other external
+# Note that settings in [% appprefix %].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 a external configuration file acting as an override for
+# with an external configuration file acting as an override for
 # local deployment.
 
 __PACKAGE__->config( name => '[% name %]' );
 
 # Start the application
-__PACKAGE__->setup;
+__PACKAGE__->setup();
 
 
 =head1 NAME
@@ -599,7 +701,7 @@ L<[% rootname %]>, L<Catalyst>
 
 =head1 LICENSE
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
@@ -610,7 +712,7 @@ package [% rootname %];
 
 use strict;
 use warnings;
-use base 'Catalyst::Controller';
+use parent 'Catalyst::Controller';
 
 #
 # Sets the actions in this controller to be registered with no prefix
@@ -630,22 +732,28 @@ __PACKAGE__->config->{namespace} = '';
 
 =cut
 
-=head2 default
+=head2 index
 
 =cut
 
-sub default : Private {
+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 
+=cut
 
 sub end : ActionClass('RenderView') {}
 
@@ -655,13 +763,16 @@ sub end : ActionClass('RenderView') {}
 
 =head1 LICENSE
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
 
 1;
 __makefile__
+[% startperl %]
+# IMPORTANT: if you delete this file your app will not work as
+# expected.  You have been warned.
 use inc::Module::Install;
 
 name '[% dir %]';
@@ -671,7 +782,8 @@ requires 'Catalyst::Runtime' => '[% 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
+requires 'parent';
+requires 'Config::General'; # This should reflect the config file format you've chosen
                  # See Catalyst::Plugin::ConfigLoader for supported formats
 catalyst;
 
@@ -679,8 +791,9 @@ install_script glob('script/*.pl');
 auto_install;
 WriteAll;
 __config__
----
-name: [% name %]
+# rename this file to [% name %].yml and put a ':' in front of 'name' if
+# you want to use YAML like in old versions of Catalyst
+name [% name %]
 __readme__
 Run script/[% appprefix %]_server.pl to test the application.
 __changes__
@@ -689,6 +802,7 @@ This file documents the revision history for Perl extension [% name %].
 0.01  [% time %]
         - initial revision, generated by Catalyst
 __apptest__
+[% startperl %]
 use strict;
 use warnings;
 use Test::More tests => 2;
@@ -697,6 +811,7 @@ BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
 
 ok( request('/')->is_success, 'Request should succeed' );
 __podtest__
+[% startperl %]
 use strict;
 use warnings;
 use Test::More;
@@ -707,6 +822,7 @@ plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
 
 all_pod_files_ok();
 __podcoveragetest__
+[% startperl %]
 use strict;
 use warnings;
 use Test::More;
@@ -743,14 +859,14 @@ See L<Catalyst::Manual>
 
 Run a Catalyst application as a cgi script.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
@@ -769,7 +885,7 @@ use [% name %];
 
 my $help = 0;
 my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
+
 GetOptions(
     'help|?'      => \$help,
     'listen|l=s'  => \$listen,
@@ -782,13 +898,13 @@ GetOptions(
 
 pod2usage(1) if $help;
 
-[% name %]->run( 
-    $listen, 
+[% name %]->run(
+    $listen,
     {   nproc   => $nproc,
-        pidfile => $pidfile, 
+        pidfile => $pidfile,
         manager => $manager,
         detach  => $detach,
-       keep_stderr => $keep_stderr,
+        keep_stderr => $keep_stderr,
     }
 );
 
@@ -801,7 +917,7 @@ pod2usage(1) if $help;
 =head1 SYNOPSIS
 
 [% appprefix %]_fastcgi.pl [options]
+
  Options:
    -? -help      display this help and exits
    -l -listen    Socket path to listen on
@@ -824,25 +940,24 @@ pod2usage(1) if $help;
 
 Run a Catalyst application as fastcgi.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
 __server__
 [% startperl %]
 
-BEGIN { 
+BEGIN {
     $ENV{CATALYST_ENGINE} ||= 'HTTP';
     $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %];
     require Catalyst::Engine::HTTP;
-}  
+}
 
 use strict;
 use warnings;
@@ -858,47 +973,91 @@ my $host              = undef;
 my $port              = $ENV{[% appenv %]_PORT} || $ENV{CATALYST_PORT} || 3000;
 my $keepalive         = 0;
 my $restart           = $ENV{[% appenv %]_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
-my $restart_delay     = 1;
-my $restart_regex     = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.pm)$';
-my $restart_directory = undef;
+my $background        = 0;
+my $pidfile           = undef;
+
+my $check_interval;
+my $file_regex;
+my $watch_directory;
+my $follow_symlinks;
 
 my @argv = @ARGV;
 
 GetOptions(
     'debug|d'             => \$debug,
-    'fork'                => \$fork,
+    'fork|f'              => \$fork,
     'help|?'              => \$help,
     'host=s'              => \$host,
     'port=s'              => \$port,
     'keepalive|k'         => \$keepalive,
     'restart|r'           => \$restart,
-    'restartdelay|rd=s'   => \$restart_delay,
-    'restartregex|rr=s'   => \$restart_regex,
-    'restartdirectory=s'  => \$restart_directory,
+    'restartdelay|rd=s'   => \$check_interval,
+    'restartregex|rr=s'   => \$file_regex,
+    'restartdirectory=s@' => \$watch_directory,
+    'followsymlinks'      => \$follow_symlinks,
+    'background'          => \$background,
+    'pidfile=s'           => \$pidfile,
 );
 
 pod2usage(1) if $help;
 
-if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
-    $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
-}
 if ( $debug ) {
     $ENV{CATALYST_DEBUG} = 1;
 }
 
-# This is require instead of use so that the above environment
-# variables can be set at runtime.
-require [% name %];
+# If we load this here, then in the case of a restarter, it does not
+# need to be reloaded for each restart.
+require Catalyst;
+
+# If this isn't done, then the Catalyst::Devel tests for the restarter
+# fail.
+$| = 1 if $ENV{HARNESS_ACTIVE};
+
+my $runner = sub {
+    # This is require instead of use so that the above environment
+    # variables can be set at runtime.
+    require [% name %];
+
+    [% name %]->run(
+        $port, $host,
+        {
+            argv       => \@argv,
+            'fork'     => $fork,
+            keepalive  => $keepalive,
+            background => $background,
+            pidfile    => $pidfile,
+        }
+    );
+};
+
+if ( $restart ) {
+    die "Cannot run in the background and also watch for changed files.\n"
+        if $background;
+
+    require Catalyst::Restarter;
+
+    my $subclass = Catalyst::Restarter->pick_subclass;
+
+    my %args;
+    $args{follow_symlinks} = 1
+        if $follow_symlinks;
+    $args{directories} = $watch_directory
+        if defined $watch_directory;
+    $args{sleep_interval} = $check_interval
+        if defined $check_interval;
+    $args{filter} = qr/$file_regex/
+        if defined $file_regex;
 
-[% name %]->run( $port, $host, {
-    argv              => \@argv,
-    'fork'            => $fork,
-    keepalive         => $keepalive,
-    restart           => $restart,
-    restart_delay     => $restart_delay,
-    restart_regex     => qr/$restart_regex/,
-    restart_directory => $restart_directory,
-} );
+    my $restarter = $subclass->new(
+        %args,
+        start_sub => $runner,
+    );
+
+    $restarter->run_and_watch;
+}
+else {
+    $runner->();
+}
 
 1;
 
@@ -921,12 +1080,17 @@ require [% name %];
    -r -restart        restart when files get modified
                       (defaults to false)
    -rd -restartdelay  delay between file checks
+                      (ignored if you have Linux::Inotify2 installed)
    -rr -restartregex  regex match files that trigger
                       a restart when modified
-                      (defaults to '\.yml$|\.yaml$|\.pm$')
+                      (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
    -restartdirectory  the directory to search for
-                      modified files
-                      (defaults to '../')
+                      modified files, can be set mulitple times
+                      (defaults to '[SCRIPT_DIR]/..')
+   -follow_symlinks   follow symlinks in search directories
+                      (defaults to false. this is a no-op on Win32)
+   -background        run the process in the background
+   -pidfile           specify filename for pid file
 
  See also:
    perldoc Catalyst::Manual
@@ -936,14 +1100,13 @@ require [% name %];
 
 Run a Catalyst Testserver for this application.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
@@ -991,14 +1154,13 @@ print request($ARGV[0])->content . "\n";
 
 Run a Catalyst action from the command line.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
@@ -1009,7 +1171,19 @@ use strict;
 use warnings;
 use Getopt::Long;
 use Pod::Usage;
-use Catalyst::Helper;
+eval "use Catalyst::Helper;";
+
+if ($@) {
+  die <<END;
+To use the Catalyst development tools including catalyst.pl and the
+generated script/myapp_create.pl you need Catalyst::Helper, which is
+part of the Catalyst-Devel distribution. Please install this via a
+vendor package or by running one of -
+
+  perl -MCPAN -e 'install Catalyst::Devel'
+  perl -MCPANPLUS -e 'install Catalyst::Devel'
+END
+}
 
 my $force = 0;
 my $mech  = 0;
@@ -1044,7 +1218,6 @@ pod2usage(1) unless $helper->mk_component( '[% name %]', @ARGV );
 
  Examples:
    [% appprefix %]_create.pl controller My::Controller
-   [% appprefix %]_create.pl controller My::Controller BindLex
    [% appprefix %]_create.pl -mechanize controller My::Controller
    [% appprefix %]_create.pl view My::View
    [% appprefix %]_create.pl view MyView TT
@@ -1067,14 +1240,13 @@ Existing component files are not overwritten.  If any of the component files
 to be created already exist the file will be written with a '.new' suffix.
 This behavior can be suppressed with the C<-force> option.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Sebastian Riedel, C<sri@oook.de>
-Maintained by the Catalyst Core Team.
+Catalyst Contributors, see Catalyst.pm
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut
@@ -1083,7 +1255,7 @@ package [% class %];
 
 use strict;
 use warnings;
-use base 'Catalyst::[% long_type %]';
+use parent 'Catalyst::[% long_type %]';
 
 =head1 NAME
 
@@ -1098,11 +1270,11 @@ Catalyst [% long_type %].
 =cut
 
 
-=head2 index 
+=head2 index
 
 =cut
 
-sub index : Private {
+sub index :Path :Args(0) {
     my ( $self, $c ) = @_;
 
     $c->response->body('Matched [% class %] in [%name%].');
@@ -1115,7 +1287,7 @@ sub index : Private {
 
 =head1 LICENSE
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut