blib/lib/ExtUtils/Helpers.pm

filter: Statementstmt 100% 39 / 39 Branchbran n/a Conditioncond 42.8% 6 / 14 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 77.7% 56 / 72 CC 6 SCAR 7.3
CC
6
Cov
85%
man3_pagename
3.1
BEGIN
3.1
man1_pagename
2.1
CRAP 2.1
« blib/lib/ExtUtils/Helpers/Unix.pm ↑ Summary
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'
l!l
04
MC/DC0%0/1
$impl_for{$^O} || 'Unix'
$impl_for{$^O}
Truth table50%1/2
A
A= $impl_for{$^O}
Aresult
11
00
16 4 ▶ my $impl = $impl_for{$^O} || 'Unix';
Condition50%1/2
$impl_for{$^O} || 'Unix'
l!l
04
MC/DC0%0/1
$impl_for{$^O} || 'Unix'
$impl_for{$^O}
Truth table50%1/2
A
A= $impl_for{$^O}
Aresult
11
00
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"}
l!l&&r!l&&!r
001
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"}
ABresult
1X1
011
000
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} || '::'
l!l
04
MC/DC0%0/1
$separator{$^O} || '::'
$separator{$^O}
Truth table50%1/2
A
A= $separator{$^O}
Aresult
11
00
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"
l!l
03
MC/DC0%0/1
$base ||= "lib"
$base
Truth table50%1/2
A
A= $base
Aresult
11
00
38 3 ▶ $ext ||= $Config{man3ext};
Condition33%1/3
$ext ||= $ExtUtils::Helpers::Config{"man3ext"}
l!l&&r!l&&!r
003
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"}
ABresult
1X1
011
000
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__
« blib/lib/ExtUtils/Helpers/Unix.pm ↑ Summary