lib/Module/Install/Inline.pm

filter: Statementstmt 50.0% 13 / 26 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 36.1% 17 / 47 CC 6 SCAR 31.6
CC
6
Cov
35%
write
42.0
Inline
2.0
BEGIN
1.0
CRAP 23.5
« lib/Module/Install/Scripts.pm ↑ Summary lib/Module/Install.pm »
1 package Module::Install::Inline;
2  
3 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 46 ▶use Module::Install::Base ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 46 ▶use vars qw{$VERSION @ISA $ISCORE};
Subroutine BEGIN: called CC=1 SCAR=0.0
7 46 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 46 $VERSION = '1.21';
9 46 @ISA = 'Module::Install::Base';
10 46 $ISCORE = 1;
11 }
12  
13 0 ▶sub Inline { $_[0] }
Subroutine Inline: not called CC=1 SCAR=6.9
Pod undocumented
14  
15 0 ▶sub write {
Subroutine write: not called CC=6 SCAR=37.4
Pod undocumented
16 0 my $self = shift;
17 0 ▶ my $name = $self->module_name || $self->name
Branch: 1 branch
BranchTrueFalseTotal
my $name = $self->module_name || $self->name or die "Please set name() before calling &Inline->write\n" 0 0 0
Condition0%0/3
$self->module_name || $self->name
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->module_name || $self->name
$self->module_name $self->name
Truth table0%0/3
A || B
A= $self->module_nameB= $self->name
ABresult
1X1
011
000
18 or die "Please set name() before calling &Inline->write\n";
19 0 $name =~ s/-/::/g;
20 0 ▶ my $object = (split(/::/, $name))[-1] or return;
Branch: 1 branch
BranchTrueFalseTotal
my $object = (split(/::/, $name, 0))[-1] or return 0 0 0
21 0 ▶ my $version = $self->version
Branch: 1 branch
BranchTrueFalseTotal
my $version = $self->version or die "Please set version() or version_from() before calling &Inline->write\n" 0 0 0
22 or die "Please set version() or version_from() before calling &Inline->write\n";
23  
24 0 ▶ $version =~ /^\d\.\d\d$/ or die <<"END_MESSAGE";
Branch: 1 branch
BranchTrueFalseTotal
$version =~ /^\d\.\d\d$/ or die "Invalid version '${version}' for $name.\nMust be of the form '#.##'. (For instance '1.23')\n" 0 0 0
25 Invalid version '$version' for $name.
26 Must be of the form '#.##'. (For instance '1.23')
27 END_MESSAGE
28  
29 0 $self->clean_files('_Inline', "$object.inl");
30 0 $self->build_requires('Inline' => 0.44); # XXX: check for existing? yagni?
31  
32 0 my $class = ref($self);
33 0 my $prefix = $self->_top->{prefix};
34 0 $self->postamble(<<"MAKEFILE");
35 # --- $class section:
36  
37 .SUFFIXES: .pm .inl
38  
39 .pm.inl:
40 \t\$(PERL) -I$prefix "-Mblib" "-MInline=NOISY,_INSTALL_" "-M$name" -e1 $version \$(INST_ARCHLIB)
41  
42 pure_all :: $object.inl
43  
44 MAKEFILE
45  
46 0 $self->Makefile->write;
47 }
48  
49 46 1;
« lib/Module/Install/Scripts.pm ↑ Summary lib/Module/Install.pm »