| 1 | package Perl::Build::Built; | ||||||||||||||||||||||||||||
| 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 utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use 5.008001; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 4 | our $VERSION = '1.34'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Carp (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use File::Spec::Functions qw( catdir catfile ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | sub run_env { | ||||||||||||||||||||||||||
|
Subroutine
run_env: called CC=6 SCAR=18.4
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 2 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||
| 15 | 2 | my $config = {}; | |||||||||||||||||||||||||||
| 16 | 2 | ▶ | if ( ref $args[0] eq 'HASH' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 0 | $config = %{ shift @args }; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | 2 | ▶ | if ( $args[0] and ref $args[0] eq 'CODE' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$args[0] and ref $args[0] eq "CODE"
MC/DC50%1/2
$args[0] and ref $args[0] eq "CODE"
$args[0]
ref $args[0] eq "CODE"
Truth table66%2/3
A and B
A= $args[0]B= ref $args[0] eq "CODE"
| |||||||||||||||||||||||||||||
| 20 | 1 | $config->{code} = shift @args; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | 2 | ▶ | if (@args) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 1 | Carp::croak( '->run_env(\%config,\&code)' | |||||||||||||||||||||||||||
| 24 | . ' or ->run_env(\&code)' | ||||||||||||||||||||||||||||
| 25 | . ' or ->run_env(\%config)' ); | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 1 | local $ENV{PATH} = $self->combined_bin_path; | |||||||||||||||||||||||||||
| 28 | 1 | my $combined_man_path = $self->combined_man_path; | |||||||||||||||||||||||||||
| 29 | 1 | ▶ | local $ENV{MANPATH} = $combined_man_path if $combined_man_path; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | 1 | delete local $ENV{PERL5LIB}; | |||||||||||||||||||||||||||
| 31 | 1 | return $config->{code}->(); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||||||||||||||||
| 35 | 1 | my ( $self, $args ) = @_; | |||||||||||||||||||||||||||
| 36 | 1 | ▶ | $args = {} unless defined $args; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 1 | ▶ | Carp::croak '->new(\%config) required' if not ref $args eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | Carp::croak 'installed_path is a mandatory parameter' | ||||||||||||||||||||||||||||
| 39 | 1 | ▶ | unless exists $args->{installed_path}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 1 | return bless $args, $self; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub installed_path { | ||||||||||||||||||||||||||
|
Subroutine
installed_path: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 44 | 0 | return $_[0]->{installed_path}; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 1 | ▶ | sub bin_path { | ||||||||||||||||||||||||||
|
Subroutine
bin_path: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 48 | 1 | return catdir( $_[0]->{installed_path}, 'bin' ); | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 2 | ▶ | sub man_path { | ||||||||||||||||||||||||||
|
Subroutine
man_path: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 52 | 2 | return catdir( $_[0]->{installed_path}, 'man' ); | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 1 | ▶ | sub combined_bin_path { | ||||||||||||||||||||||||||
|
Subroutine
combined_bin_path: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 56 | 1 | return $_[0]->bin_path . ':' . $ENV{PATH}; | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 2 | ▶ | sub combined_man_path { | ||||||||||||||||||||||||||
|
Subroutine
combined_man_path: called CC=2 SCAR=8.1
Pod
documented
| |||||||||||||||||||||||||||||
| 60 | 2 | ▶ | if ( -d $_[0]->man_path ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | 0 | return $_[0]->man_path . ':' . $ENV{MANPATH}; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | 2 | return $ENV{MANPATH}; | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 4 | 1; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | __END__ | ||||||||||||||||||||||||||||