Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
be a little less aggressive in changes to Growing
  • Loading branch information
jberger committed Nov 24, 2014
1 parent c118ac0 commit 5e86331
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -603,14 +603,7 @@ applications can use nested routes they have no need for C<group> blocks.

=head2 Simplified application script

C<myapp.pl> can be moved into a C<script> directory and renamed to C<my_app> to
follow the CPAN standard.

$ mkdir script
$ mv myapp.pl script/my_app
$ chmod 744 script/my_app

The script itself can now be turned into a simplified application script to
C<myapp.pl> itself can now be turned into a simplified application script to
allow running tests again.

#!/usr/bin/env perl
Expand All @@ -621,15 +614,15 @@ allow running tests again.
use lib 'lib';

# Start command line interface for application

require Mojolicious::Commands;
Mojolicious::Commands->start_app('MyApp');

The resulting directory structure of our hybrid application should be looking
like this.
And the directory structure of our hybrid application should be looking like
this.

myapp
|- script
+- my_app
|- myapp.pl
|- lib
| |- MyApp.pm
| +- MyApp
Expand Down Expand Up @@ -727,6 +720,15 @@ moved into the appropriate directories.
$ mv templates/index.html.ep templates/login/index.html.ep
$ mv templates/protected.html.ep templates/login/protected.html.ep

=head2 Script

Finally C<myapp.pl> can be moved into a C<script> directory and renamed to
C<my_app> follow the CPAN standard.

$ mkdir script
$ mv myapp.pl script/my_app
$ chmod 744 script/my_app

=head2 Simplified tests

Full L<Mojolicious> applications are a little easier to test, so C<t/login.t>
Expand Down

0 comments on commit 5e86331

Please sign in to comment.