ArchivableFormats/Plugin.pm

filter: Statementstmt 82.3% 14 / 17 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 79.1% 19 / 24 CC 2 SCAR 5.1
CC
2
Cov
79%
allowed_extensions
2.1
_not_allowed
2.0
BEGIN
1.0
CRAP 1.7
« ArchivableFormats.pm ↑ Summary ArchivableFormats/Plugin/DANS.pm »
1 package File::ArchivableFormats::Plugin;
2 5 our $VERSION = '1.8';
3 5 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # ABSTRACT: Role which implements logic for all plugins
7  
8 5 requires '_build_preferred_formats';
9  
10 5 has preferred_formats => (
11 is => 'ro',
12 isa => 'HashRef',
13 traits => ['Hash'],
14 lazy => 1,
15 builder => '_build_preferred_formats',
16 handles => {
17 is_archivable => 'defined',
18 get_info => 'get',
19  
20 }
21 );
22  
23 5 has name => (
24 is => 'ro',
25 isa => 'Str',
26 required => 1,
27 );
28  
29 0 ▶sub _not_allowed {
Subroutine _not_allowed: not called CC=1 SCAR=6.9
30 0 my $self = shift;
31 0 return { types => [], allowed_extensions => [] };
32 }
33  
34 2 ▶sub allowed_extensions {
Subroutine allowed_extensions: called CC=2 SCAR=7.6
Pod documented
35 2 my ($self, $mimetype) = @_;
36  
37 2 ▶ if ($self->is_archivable($mimetype)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->is_archivable($mimetype)) 2 0 2
38 2 return $self->get_info($mimetype);
39 }
40  
41 0 return $self->_not_allowed;
42 }
43  
44 5 1;
45  
46 __END__
« ArchivableFormats.pm ↑ Summary ArchivableFormats/Plugin/DANS.pm »