Module/Install/MasonXComponent.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 58.0% 18 / 31 CC 2 SCAR 9.8
CC
2
Cov
54%
mason_component
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« MasonX/Component/Registry/Reader.pm ↑ Summary MasonX/Component.pm »
1 ## no critic
2 package Module::Install::MasonXComponent;
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Module::Install::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use vars qw{$VERSION $ISCORE @ISA};
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 $VERSION = '0.01';
10 1 $ISCORE = 0;
11 1 @ISA = qw{Module::Install::Base};
12 }
13  
14 =head1 METHODS
15  
16 =head2 mason_component
17  
18 =over 4
19  
20 =item Arguments: $directory?
21  
22 =item Return Value: none
23  
24 =back
25  
26 =cut
27  
28 0 ▶sub mason_component {
Subroutine mason_component: not called CC=2 SCAR=17.9
Pod documented
29 0 my ($self, $dir) = @_;
30  
31 0 ▶ $dir ||= 'component';
Condition0%0/2
$dir ||= "component"
l!l
00
MC/DC0%0/1
$dir ||= "component"
$dir
Truth table0%0/2
A
A= $dir
Aresult
11
00
32  
33 0 my %dests = (
34 site => 'DESTINSTALLSITELIB',
35 vendor => 'DESTINSTALLVENDORLIB',
36 perl => 'DESTINSTALLPRIVLIB',
37 );
38  
39 0 my $register_proto = <<"EOR";
40 register_%s_component ::
41 \t\$(FULLPERL) -MMasonX::Component::Registry \\
42 \t\t-e"MasonX::Component::Registry->install_component(q(\$(NAME)), {\\
43 \t\t%\{ MasonX::Component::Registry->reader->read_file(q(component.ini))->{\$(NAME)} }, \\
44 \t\tcomp_root => q(\$(%s)\$(DFSEP)auto\$(DFSEP)\$(FULLEXT))})"
45  
46 EOR
47  
48 my $register = join ('', map {
49 0 sprintf $register_proto, $_, $dests{$_}
50 } keys %dests);
51  
52 0 $self->postamble(<<"END_MAKEFILE");
53 config ::
54 \t\$(NOECHO) \$(MOD_INSTALL) \\
55 \t\t"$dir" \$(INST_AUTODIR)\$(DFSEP)_component
56  
57 install :: register_component
58  
59 register_component :: register_\$(INSTALLDIRS)_component
60  
61 register__component :: register_site_component
62 \t\$(NOECHO) \$(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
63  
64 $register
65 END_MAKEFILE
66  
67 # The above appears to behave incorrectly when used with old versions
68 # of ExtUtils::Install (known-bad on RHEL 3, with 5.8.0)
69 # So when we need to install a share directory, make sure we add a
70 # dependency on a moderately new version of ExtUtils::MakeMaker.
71 0 $self->build_requires( 'ExtUtils::MakeMaker' => '6.11' );
72  
73 0 return;
74 }
75  
76 1 1;
« MasonX/Component/Registry/Reader.pm ↑ Summary MasonX/Component.pm »