lib/Archive/BagIt/Role/Plugin.pm

filter: Statementstmt 66.6% 22 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 2 totaltotal 65.1% 28 / 43 CC 1 SCAR 2.2
CC
1
Cov
67%
load_plugin
2.0
BUILD
2.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Archive/BagIt/Role/OpenSSL/Async.pm ↑ Summary lib/Archive/BagIt/Role/OpenSSL/Sync.pm »
1 package Archive::BagIt::Role::Plugin;
2 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use Module::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 # ABSTRACT: A role that handles plugin loading
8 13 our $VERSION = '0.103'; # VERSION
9  
10 13 has plugin_name => (
11 is => 'ro',
12 #isa => 'Str',
13 default => __PACKAGE__,
14 );
15  
16 0 ▶sub load_plugin {
Subroutine load_plugin: not called CC=1 SCAR=6.9
Pod undocumented
17 0 my ($self, $algo) = @_;
18  
19 # Einheitlicher Plugin-Name anstelle getrennter Algorithm/Manifest Module
20 0 my $plugin_class = "Archive::BagIt::Plugin::$algo";
21  
22 0 load $plugin_class;
23  
24 0 my $plugin = $plugin_class->new;
25  
26 # Registrierung des Plugins sowohl als Hash-Algorithmus als auch für Manifeste
27 0 $self->register_algorithm($algo, $plugin);
28 0 $self->register_manifest($algo, $plugin);
29  
30 0 return $plugin;
31 }
32  
33  
34 13 has bagit => (
35 is => 'ro',
36 #isa => 'Archive::BagIt',
37 required => 1,
38 weak_ref => 1,
39 );
40  
41 0 ▶sub BUILD {
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
42 0 my ($self) = @_;
43 0 my $plugin_name = $self->plugin_name;
44 0 $self->bagit->plugins( { $plugin_name => $self });
45 0 return 1;
46 }
47 13 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 13 1;
49  
50 __END__
« blib/lib/Archive/BagIt/Role/OpenSSL/Async.pm ↑ Summary lib/Archive/BagIt/Role/OpenSSL/Sync.pm »