File Coverage

blib/lib/File/KeePass/Agent/KDBX.pm
Criterion Covered Total %
statement 25 27 92.5
branch 2 4 50.0
condition 4 12 33.3
subroutine 9 10 90.0
pod 3 4 75.0
total 43 57 75.4


line stmt bran cond sub pod time code
1             package File::KeePass::Agent::KDBX;
2             # ABSTRACT: A KeePass 2 agent
3              
4 1     1   908 use utf8;
  1         12  
  1         5  
5 1     1   26 use warnings;
  1         2  
  1         21  
6 1     1   4 use strict;
  1         2  
  1         16  
7              
8 1     1   367 use Module::Load;
  1         905  
  1         5  
9 1     1   429 use namespace::clean;
  1         12772  
  1         4  
10              
11 1     1   542 use parent 'File::KeePass::Agent';
  1         237  
  1         5  
12              
13             our $VERSION = '0.902'; # VERSION
14              
15             our $KEEPASS_CLASS;
16              
17             sub new {
18 1     1 1 2 my $class = shift;
19 1 50 33     6 my %args = @_ == 1 && (ref $_[0] eq 'HASH') ? %{$_[0]} : @_;
  0         0  
20 1         3 return bless \%args, $class;
21             }
22              
23 0     0 1 0 sub run { __PACKAGE__->new->SUPER::run(@_) }
24              
25              
26             sub keepass_class {
27             (ref $_[0] eq 'HASH') && $_[0]->{keepass_class}
28 5 50 33 5 1 822 || $KEEPASS_CLASS || $ENV{PERL_FILE_KEEPASS_CLASS} || 'File::KeePass::KDBX';
      33        
      33        
29             }
30              
31             sub load_keepass {
32 1     1 0 3 my $self = shift;
33 1         2 load $self->keepass_class;
34 1         102111 return $self->SUPER::load_keepass(@_);
35             }
36              
37             1;
38              
39             __END__