File Coverage

blib/lib/Dancer2/Plugin/Pg.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Dancer2::Plugin::Pg;
2              
3 1     1   21367 use Dancer2::Plugin;
  1         65470  
  1         5  
4 1     1   464 use Dancer2::Plugin::Pg::Core;
  1         3  
  1         122  
5              
6             our $VERSION = '0.04';
7              
8             register Pg => sub {
9             my $dsl = shift;
10             my $connection = shift;
11             my $conf;
12             if($connection) {
13             $conf = plugin_setting()->{connections}->{$connection};
14             }else{
15             if (plugin_setting()->{connections}->{default}) {
16             $conf = plugin_setting()->{connections}->{default};
17             }else{
18             $conf = plugin_setting();
19             }
20             }
21            
22             return Dancer2::Plugin::Pg::Core->new($conf);
23             };
24              
25             register_plugin;
26              
27             1;
28              
29             __END__