Setup/Flavor/Lite.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 36 CC 1 SCAR 6.9
CC
1
Cov
0%
run
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use strict;
2 use warnings;
3 use utf8;
4  
5 package Amon2::Setup::Flavor::Lite;
6 use parent qw(Amon2::Setup::Flavor);
7  
8 sub run {
9 my ($self) = @_;
10  
11 require Amon2::Lite;
12 require Amon2;
13  
14 $self->{amon2_version} = $Amon2::VERSION;
15 $self->{amon2_lite_version} = $Amon2::Lite::VERSION;
16  
17 $self->write_file('app.psgi', <<'...');
18 use strict;
19 use warnings;
20 use utf8;
21 use File::Spec;
22 use File::Basename;
23 use lib File::Spec->catdir(dirname(__FILE__), 'extlib', 'lib', 'perl5');
24 use lib File::Spec->catdir(dirname(__FILE__), 'lib');
25 use Amon2::Lite;
26  
27 our $VERSION = '0.13';
28  
29 # put your configuration here
30 sub load_config {
31 my $c = shift;
32  
33 my $mode = $c->mode_name || 'development';
34  
35 +{
36 'DBI' => [
37 "dbi:SQLite:dbname=$mode.db",
38 '',
39 '',
40 ],
41 }
42 }
43  
44 get '/' => sub {
45 my $c = shift;
46 return $c->render('index.tt');
47 };
48  
49 # load plugins
50 __PACKAGE__->load_plugin('Web::CSRFDefender' => {
51 post_only => 1,
52 });
53 # __PACKAGE__->load_plugin('DBI');
54 # __PACKAGE__->load_plugin('Web::FillInFormLite');
55 # __PACKAGE__->load_plugin('Web::JSON');
56  
57 __PACKAGE__->enable_session();
58  
59 __PACKAGE__->to_app(handle_static => 1);
60  
61 __DATA__