blib/lib/Mojolicious/Command/generate/callbackery_app/lib/App.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
CRAP 2.0
1 % my $p = shift;
2 package <%= $p->{class} %>;
3  
4 use Mojo::Base 'CallBackery';
5  
6 =head1 NAME
7  
8 <%= $p->{class} %> - the application class
9  
10 =head1 SYNOPSIS
11  
12 use Mojolicious::Commands;
13 Mojolicious::Commands->start_app('<%= $p->{class} %>');
14  
15 =head1 DESCRIPTION
16  
17 Configure the mojolicious engine to run our application logic
18  
19 =cut
20  
21 =head1 ATTRIBUTES
22  
23 <%= $p->{class} %> has all the attributes of L<CallBackery> plus:
24  
25 =cut
26  
27 =head2 config
28  
29 use our own plugin directory and our own configuration file:
30  
31 =cut
32  
33 has config => sub {
34 my $self = shift;
35 my $config = $self->SUPER::config(@_);
36 $config->file($ENV{<%= $p->{class} %>_CONFIG} || $self->home->rel_file('etc/<%= $p->{name} %>.cfg'));
37 unshift @{$config->pluginPath}, '<%= $p->{class} %>::GuiPlugin';
38 return $config;
39 };
40  
41 has database => sub {
42 my $self = shift;
43 my $database = $self->SUPER::database(@_);
44 $database->sql->migrations
45 ->name('<%= $p->{class} %>BaseDB')
46 ->from_data(__PACKAGE__,'appdb.sql')
47 ->migrate;
48 return $database;
49 };
50  
51 1;
52  
53 =head1 COPYRIGHT
54  
55 Copyright (c) <%= $p->{year} %> by <%= $p->{fullName} %>. All rights reserved.
56  
57 =head1 AUTHOR
58  
59 S<<%= $p->{fullName} %> E<lt><%= $p->{email} %>E<gt>>
60  
61 =cut
62  
63 __DATA__