blib/lib/Module/Install/CheckLib.pm

filter: Statementstmt 85.1% 40 / 47 Branchbran 50.0% 7 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 80.2% 57 / 71 CC 8 SCAR 10.9
CC
8
Cov
77%
_author_side
4.1
checklibs
3.8
assertlibs
3.8
CRAP 3.0
« inc/Module/Install/Win32.pm ↑ Summary inc/Module/Install/Base.pm »
1 package Module::Install::CheckLib;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use base qw(Module::Install::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 $VERSION = '0.14';
10  
11 1 ▶sub checklibs {
Subroutine checklibs: called CC=3 SCAR=13.5
Pod documented
12 1 my $self = shift;
13 1 ▶ return unless scalar @_;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @_ 0 1 1
14 1 my %parms = @_;
15 1 ▶ unless (_author_side(delete $parms{run_checks_as_author})) {
Branch: 1 branch
BranchTrueFalseTotal
unless (_author_side(delete $parms{"run_checks_as_author"})) 0 1 1
16 0 require Devel::CheckLib;
17 0 Devel::CheckLib::check_lib_or_exit( %parms );
18 0 return;
19 }
20 }
21  
22 1 ▶sub assertlibs {
Subroutine assertlibs: called CC=3 SCAR=13.5
Pod documented
23 1 my $self = shift;
24 1 ▶ return unless scalar @_;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @_ 0 1 1
25 1 my %parms = @_;
26 1 ▶ unless (_author_side(delete $parms{run_checks_as_author})) {
Branch: 1 branch
BranchTrueFalseTotal
unless (_author_side(delete $parms{"run_checks_as_author"})) 0 1 1
27 0 require Devel::CheckLib;
28 0 Devel::CheckLib::assert_lib( %parms );
29 0 return;
30 }
31 }
32  
33 2 ▶sub _author_side {
Subroutine _author_side: called CC=4 SCAR=14.1
34 2 my $run_checks_as_author = shift;
35 2 ▶ if ($Module::Install::AUTHOR) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Module::Install::AUTHOR) 2 0 2
36 2 mkdir 'inc';
37 2 mkdir 'inc/Devel';
38 2 print "Extra directories created under inc/\n";
39 2 require Devel::CheckLib;
40 2 local $/ = undef;
41 2 ▶ open(CHECKLIBPM, $INC{'Devel/CheckLib.pm'}) ||
Branch: 1 branch
BranchTrueFalseTotal
open CHECKLIBPM, $INC{"Devel/CheckLib.pm"} or die qq[Can't read $INC{"Devel/CheckLib.pm"}: $!] 2 0 2
42 die("Can't read $INC{'Devel/CheckLib.pm'}: $!");
43 2 (my $checklibpm = <CHECKLIBPM>) =~ s/package Devel::CheckLib/package #\nDevel::CheckLib/;
44 2 close(CHECKLIBPM);
45 2 ▶ open(CHECKLIBPM, '>'.File::Spec->catfile(qw(inc Devel CheckLib.pm))) ||
Branch: 1 branch
BranchTrueFalseTotal
open CHECKLIBPM, '>' . "File::Spec"->catfile("inc", "Devel", "CheckLib.pm") or die "Can't write inc/Devel/CheckLib.pm: $!" 2 0 2
46 die("Can't write inc/Devel/CheckLib.pm: $!");
47 2 print CHECKLIBPM $checklibpm;
48 2 close(CHECKLIBPM);
49  
50 2 print "Copied Devel::CheckLib to inc/ directory\n";
51 2 return !$run_checks_as_author;
52 }
53 0 return 0;
54 }
55  
56 4 'All your libs are belong';
57  
58 __END__
« inc/Module/Install/Win32.pm ↑ Summary inc/Module/Install/Base.pm »