| 1 | package ExtUtils::Helpers; | ||||||||||||||||||||
| 2 | 4 | $ExtUtils::Helpers::VERSION = '0.028'; | |||||||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 4 | ▶ | use warnings FATAL => 'all'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 4 | ▶ | use Exporter 5.57 'import'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 4 | ▶ | use Config; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 4 | ▶ | use File::Basename qw/basename/; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 4 | ▶ | use File::Spec::Functions qw/splitpath canonpath abs2rel splitdir/; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 4 | our @EXPORT_OK = qw/make_executable split_like_shell man1_pagename man3_pagename detildefy/; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 4 | ▶ | BEGIN { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=3 SCAR=11.3
| |||||||||||||||||||||
| 14 | 4 | my %impl_for = ( MSWin32 => 'Windows', VMS => 'VMS'); | |||||||||||||||||||
| 15 | 4 | ▶ | my $package = 'ExtUtils::Helpers::' . ($impl_for{$^O} || 'Unix'); | ||||||||||||||||||
|
Condition50%1/2
$impl_for{$^O} || 'Unix'
MC/DC0%0/1
$impl_for{$^O} || 'Unix'
$impl_for{$^O}
Truth table50%1/2
A
A= $impl_for{$^O}
| |||||||||||||||||||||
| 16 | 4 | ▶ | my $impl = $impl_for{$^O} || 'Unix'; | ||||||||||||||||||
|
Condition50%1/2
$impl_for{$^O} || 'Unix'
MC/DC0%0/1
$impl_for{$^O} || 'Unix'
$impl_for{$^O}
Truth table50%1/2
A
A= $impl_for{$^O}
| |||||||||||||||||||||
| 17 | 4 | require "ExtUtils/Helpers/$impl.pm"; | |||||||||||||||||||
| 18 | 4 | "ExtUtils::Helpers::$impl"->import(); | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 1 | ▶ | sub man1_pagename { | ||||||||||||||||||
|
Subroutine
man1_pagename: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 22 | 1 | my ($filename, $ext) = @_; | |||||||||||||||||||
| 23 | 1 | ▶ | $ext ||= $Config{man1ext}; | ||||||||||||||||||
|
Condition33%1/3
$ext ||= $ExtUtils::Helpers::Config{"man1ext"}
MC/DC0%0/2
$ext ||= $ExtUtils::Helpers::Config{"man1ext"}
$ext
$ExtUtils::Helpers::Config{"man1ext"}
Truth table33%1/3
A ||= B
A= $extB= $ExtUtils::Helpers::Config{"man1ext"}
| |||||||||||||||||||||
| 24 | 1 | return basename($filename).".$ext"; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 4 | my %separator = ( | |||||||||||||||||||
| 28 | MSWin32 => '.', | ||||||||||||||||||||
| 29 | VMS => '__', | ||||||||||||||||||||
| 30 | os2 => '.', | ||||||||||||||||||||
| 31 | cygwin => '.', | ||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||
| 33 | 4 | ▶ | my $separator = $separator{$^O} || '::'; | ||||||||||||||||||
|
Condition50%1/2
$separator{$^O} || '::'
MC/DC0%0/1
$separator{$^O} || '::'
$separator{$^O}
Truth table50%1/2
A
A= $separator{$^O}
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 3 | ▶ | sub man3_pagename { | ||||||||||||||||||
|
Subroutine
man3_pagename: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||||||||||
| 36 | 3 | my ($filename, $base, $ext) = @_; | |||||||||||||||||||
| 37 | 3 | ▶ | $base ||= 'lib'; | ||||||||||||||||||
|
Condition50%1/2
$base ||= "lib"
MC/DC0%0/1
$base ||= "lib"
$base
Truth table50%1/2
A
A= $base
| |||||||||||||||||||||
| 38 | 3 | ▶ | $ext ||= $Config{man3ext}; | ||||||||||||||||||
|
Condition33%1/3
$ext ||= $ExtUtils::Helpers::Config{"man3ext"}
MC/DC0%0/2
$ext ||= $ExtUtils::Helpers::Config{"man3ext"}
$ext
$ExtUtils::Helpers::Config{"man3ext"}
Truth table33%1/3
A ||= B
A= $extB= $ExtUtils::Helpers::Config{"man3ext"}
| |||||||||||||||||||||
| 39 | 3 | my ($vols, $dirs, $file) = splitpath(canonpath(abs2rel($filename, $base))); | |||||||||||||||||||
| 40 | 3 | $file = basename($file, qw/.pm .pod/); | |||||||||||||||||||
| 41 | 3 | my @dirs = grep { length } splitdir($dirs); | |||||||||||||||||||
| 42 | 3 | return join $separator, @dirs, "$file.$ext"; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 4 | 1; | |||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | # ABSTRACT: Various portability utilities for module builders | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||