callbackery_app/lib/App.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 28 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package <%= ${class} %>;
2  
3 use Mojo::Base 'CallBackery';
4 use CallBackery::Model::ConfigJsonSchema;
5  
6 =head1 NAME
7  
8 <%= ${class} %> - the application class
9  
10 =head1 SYNOPSIS
11  
12 use Mojolicious::Commands;
13 Mojolicious::Commands->start_app('<%= ${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 <%= ${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 = CallBackery::Model::ConfigJsonSchema->new(
36 app => $self,
37 file => $ENV{<%= ${class} %>_CONFIG} || $self->home->rel_file('etc/<%= ${filename} %>.yaml')
38 );
39 unshift @{$config->pluginPath}, '<%= ${class} %>::GuiPlugin';
40 return $config;
41 };
42  
43  
44 has database => sub {
45 my $self = shift;
46 my $database = $self->SUPER::database(@_);
47 $database->sql->migrations
48 ->name('<%= ${class} %>BaseDB')
49 ->from_data(__PACKAGE__,'appdb.sql')
50 ->migrate;
51 return $database;
52 };
53  
54 1;
55  
56 =head1 COPYRIGHT
57  
58 Copyright (c) <%= ${year} %> by <%= ${fullName} %>. All rights reserved.
59  
60 =head1 AUTHOR
61  
62 S<<%= ${fullName} %> E<lt><%= ${email} %>E<gt>>
63  
64 =cut
65  
66 __DATA__