| 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 | 0 | ▶ | sub new { # ; | ||||||||
|
Subroutine
new: not called CC=5 SCAR=29.1
Pod
undocumented
| |||||||||||
| 13 | 0 | my ($class, %params) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | my $self = +{ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | (ref $class ? (%$class) : ()), | ||||||||||
| 17 | %params, | ||||||||||
| 18 | }; | ||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | $self = bless $self, ref $class ? ref $class : $class; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | unless (ref $class) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 0 | ▶ | sub plugin_requires { # ; | ||||||||
|
Subroutine
plugin_requires: not called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | ###################################################################### | ||||||||||
| 36 | 0 | ▶ | sub distribution_object { # ; | ||||||||
|
Subroutine
distribution_object: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 37 | 0 | my ($self) = @_; | |||||||||
| 38 | 0 | $self->{distribution_object}; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | ###################################################################### | ||||||||||
| 42 | 0 | ▶ | sub distribution { # ; | ||||||||
|
Subroutine
distribution: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 43 | 0 | my ($self) = @_; | |||||||||
| 44 | |||||||||||
| 45 | 0 | my $distribution = $self->distribution_object->id; | |||||||||
| 46 | 0 | ▶ | CPAN::Shell->expand("Distribution",$distribution) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | or $self->frontend->mydie("Unknowns distribution '$distribution'\n"); | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | ###################################################################### | ||||||||||
| 51 | 0 | ▶ | sub distribution_info { # ; | ||||||||
|
Subroutine
distribution_info: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 52 | 0 | my ($self) = @_; | |||||||||
| 53 | |||||||||||
| 54 | 0 | CPAN::DistnameInfo->new ($self->distribution->id); | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | ###################################################################### | ||||||||||
| 58 | 0 | ▶ | sub build_dir { # ; | ||||||||
|
Subroutine
build_dir: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 59 | 0 | my ($self) = @_; | |||||||||
| 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
| |||||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | ###################################################################### | ||||||||||
| 66 | 0 | ▶ | sub is_xs { # | ||||||||
|
Subroutine
is_xs: not called CC=2 SCAR=13.4
Pod
documented
| |||||||||||
| 67 | 0 | my ($self) = @_; | |||||||||
| 68 | |||||||||||
| 69 | 0 | ▶ | my @xs = glob File::Spec->catfile ($self->build_dir, '*.xs'); # quick try | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||
| 70 | |||||||||||
| 71 | 0 | ▶ | unless (@xs) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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__ | ||||||||||