lib/CPAN/Plugin.pm

filter: Statementstmt 33.3% 12 / 36 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 30.0% 3 / 10 Podpod 85.7% 6 / 7 totaltotal 32.3% 21 / 65 CC 8 SCAR 20.8
CC
8
Cov
25%
new
18.4
distribution
6.0
build_dir
6.0
CRAP 8.0
« blib/lib/CPAN/Distroprefs.pm ↑ Summary blib/lib/CPAN/HTTP/Credentials.pm »
1 package CPAN::Plugin;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.97';
7  
8 1 require CPAN;
9  
10 ######################################################################
11  
12 sub new { # ;
13 0 ▶ my ($class, %params) = @_;
Subroutine new: not called CC=5 SCAR=29.1
Pod undocumented
14  
15 0 ▶ my $self = +{
Branch: 1 branch
BranchTrueFalseTotal
ref $class ? : 0 0 0
16 (ref $class ? (%$class) : ()),
17 %params,
18 };
19  
20 0 ▶ $self = bless $self, ref $class ? ref $class : $class;
Branch: 1 branch
BranchTrueFalseTotal
ref $class ? : 0 0 0
21  
22 0 ▶ unless (ref $class) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $class) 0 0 0
23 0 local $_;
24 1 ▶ no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
25 0 $CPAN::META->use_inst ($_) for $self->plugin_requires;
26 }
27  
28 0 $self;
29 }
30  
31 ######################################################################
32 ▶sub plugin_requires { # ;
Subroutine plugin_requires: not called CC=1 SCAR=0.0
Pod documented
33 }
34  
35 ######################################################################
36 sub distribution_object { # ;
37 0 ▶ my ($self) = @_;
Subroutine distribution_object: not called CC=1 SCAR=6.9
Pod documented
38 0 $self->{distribution_object};
39 }
40  
41 ######################################################################
42 sub distribution { # ;
43 0 ▶ my ($self) = @_;
Subroutine distribution: not called CC=2 SCAR=17.9
Pod documented
44  
45 0 my $distribution = $self->distribution_object->id;
46 0 ▶ CPAN::Shell->expand("Distribution",$distribution)
Branch: 1 branch
BranchTrueFalseTotal
"CPAN::Shell"->expand("Distribution", $distribution) or $self->frontend->mydie("Unknowns distribution '${distribution}'\n") 0 0 0
47 or $self->frontend->mydie("Unknowns distribution '$distribution'\n");
48 }
49  
50 ######################################################################
51 sub distribution_info { # ;
52 0 ▶ my ($self) = @_;
Subroutine distribution_info: not called CC=1 SCAR=6.9
Pod documented
53  
54 0 CPAN::DistnameInfo->new ($self->distribution->id);
55 }
56  
57 ######################################################################
58 sub build_dir { # ;
59 0 ▶ my ($self) = @_;
Subroutine build_dir: not called CC=2 SCAR=17.9
Pod documented
60  
61 my $build_dir = $self->distribution->{build_dir}
62 0 ▶ or $self->frontend->mydie("Distribution has not been built yet, cannot proceed");
Branch: 1 branch
BranchTrueFalseTotal
my $build_dir = $self->distribution->{"build_dir"} or $self->frontend->mydie("Distribution has not been built yet, cannot proceed") 0 0 0
63 }
64  
65 ######################################################################
66 sub is_xs { #
67 0 ▶ my ($self) = @_;
Subroutine is_xs: not called CC=2 SCAR=17.9
Pod documented
68  
69 0 my @xs = glob File::Spec->catfile ($self->build_dir, '*.xs'); # quick try
70  
71 0 ▶ unless (@xs) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@xs) 0 0 0
72 0 require ExtUtils::Manifest;
73 0 my $manifest_file = File::Spec->catfile ($self->build_dir, "MANIFEST");
74 0 my $manifest = ExtUtils::Manifest::maniread($manifest_file);
75 0 @xs = grep /\.xs$/, keys %$manifest;
76 }
77  
78 0 scalar @xs;
79 }
80  
81 ######################################################################
82  
83 package CPAN::Plugin;
84  
85 1 1;
86  
87 __END__
« blib/lib/CPAN/Distroprefs.pm ↑ Summary blib/lib/CPAN/HTTP/Credentials.pm »