lib/CPANPLUS/Internals/Constants.pm

filter: Statementstmt 90.3% 374 / 414 Branchbran 46.8% 30 / 64 Conditioncond 25.0% 2 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 89.9% 134 / 149 Podpod 0.0% 0 / 1 totaltotal 84.2% 540 / 641 CC 36 SCAR 7.3
CC
36
Cov
84%
__ANON__
11.5
__ANON__
6.0
__ANON__
6.0
CRAP 2.1
« lib/CPANPLUS/Module/Author/Fake.pm ↑ Summary blib/lib/CPANPLUS/Backend/RV.pm »
1 package CPANPLUS::Internals::Constants;
2  
3 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 20 ▶use CPANPLUS::Error;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 20 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 20 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 20 ▶use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 20 require Exporter;
12 20 ▶use vars qw[$VERSION @ISA @EXPORT];
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 20 ▶use Package::Constants;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 20 $VERSION = "0.9914";
17 20 @ISA = qw[Exporter];
18 20 @EXPORT = Package::Constants->list( __PACKAGE__ );
19  
20 0 ▶sub constants { @EXPORT };
Subroutine constants: not called CC=1 SCAR=6.9
Pod undocumented
21  
22 20 use constant INSTALLER_BUILD
23 20 ▶ => 'CPANPLUS::Dist::Build';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 20 ▶use constant INSTALLER_MM => 'CPANPLUS::Dist::MM';
Subroutine BEGIN: called CC=1 SCAR=0.0
25 20 use constant INSTALLER_SAMPLE
26 20 ▶ => 'CPANPLUS::Dist::Sample';
Subroutine BEGIN: called CC=1 SCAR=0.0
27 20 ▶use constant INSTALLER_BASE => 'CPANPLUS::Dist::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
28 20 use constant INSTALLER_AUTOBUNDLE
29 20 ▶ => 'CPANPLUS::Dist::Autobundle';
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 20 ▶use constant SHELL_DEFAULT => 'CPANPLUS::Shell::Default';
Subroutine BEGIN: called CC=1 SCAR=0.0
32 20 ▶use constant SHELL_CLASSIC => 'CPANPLUS::Shell::Classic';
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 20 ▶use constant CONFIG => 'CPANPLUS::Config';
Subroutine BEGIN: called CC=1 SCAR=0.0
35 20 ▶use constant CONFIG_USER => 'CPANPLUS::Config::User';
Subroutine BEGIN: called CC=1 SCAR=0.0
36 20 ▶use constant CONFIG_SYSTEM => 'CPANPLUS::Config::System';
Subroutine BEGIN: called CC=1 SCAR=0.0
37 20 ▶use constant CONFIG_BOXED => 'CPANPLUS::Config::Boxed';
Subroutine BEGIN: called CC=1 SCAR=0.0
38  
39 20 use constant DEFAULT_SOURCE_ENGINE
40 20 ▶ => 'CPANPLUS::Internals::Source::Memory';
Subroutine BEGIN: called CC=1 SCAR=0.0
41  
42 20 ▶use constant TARGET_INIT => 'init';
Subroutine BEGIN: called CC=1 SCAR=0.0
43 20 ▶use constant TARGET_CREATE => 'create';
Subroutine BEGIN: called CC=1 SCAR=0.0
44 20 ▶use constant TARGET_PREPARE => 'prepare';
Subroutine BEGIN: called CC=1 SCAR=0.0
45 20 ▶use constant TARGET_INSTALL => 'install';
Subroutine BEGIN: called CC=1 SCAR=0.0
46 20 ▶use constant TARGET_IGNORE => 'ignore';
Subroutine BEGIN: called CC=1 SCAR=0.0
47  
48 20 ▶use constant ON_WIN32 => $^O eq 'MSWin32';
Subroutine BEGIN: called CC=1 SCAR=0.0
49 20 ▶use constant ON_NETWARE => $^O eq 'NetWare';
Subroutine BEGIN: called CC=1 SCAR=0.0
50 20 ▶use constant ON_CYGWIN => $^O eq 'cygwin';
Subroutine BEGIN: called CC=1 SCAR=0.0
51 20 ▶use constant ON_VMS => $^O eq 'VMS';
Subroutine BEGIN: called CC=1 SCAR=0.0
52 20 ▶use constant ON_MINIX => $^O eq 'minix';
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 20 ▶use constant DOT_CPANPLUS => ON_VMS ? '_cpanplus' : '.cpanplus';
Subroutine BEGIN: called CC=1 SCAR=0.0
55  
56 20 ▶use constant OPT_AUTOFLUSH => '-MCPANPLUS::Internals::Utils::Autoflush';
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58 20 use constant UNKNOWN_DL_LOCATION
59 20 ▶ => 'UNKNOWN-ORIGIN';
Subroutine BEGIN: called CC=1 SCAR=0.0
60  
61 20 ▶use constant NMAKE => 'nmake.exe';
Subroutine BEGIN: called CC=1 SCAR=0.0
62 20 use constant NMAKE_URL =>
63 20 ▶ 'ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe';
Subroutine BEGIN: called CC=1 SCAR=0.0
64  
65 use constant INSTALL_VIA_PACKAGE_MANAGER
66 11 ▶ => sub { my $fmt = $_[0] or return;
Subroutine __ANON__: called CC=4 SCAR=24.4
Branch: 1 branch
BranchTrueFalseTotal
my $fmt = $_[0] or return 11 0 11
67 0 ▶ return 1 if $fmt ne INSTALLER_BUILD and
Branch: 1 branch
BranchTrueFalseTotal
if $fmt ne "CPANPLUS::Dist::Build" and $fmt ne "CPANPLUS::Dist::MM" 0 0 0
Condition0%0/3
$fmt ne "CPANPLUS::Dist::Build" and $fmt ne "CPANPLUS::Dist::MM"
!ll&&!rl&&r
000
MC/DC0%0/2
$fmt ne "CPANPLUS::Dist::Build" and $fmt ne "CPANPLUS::Dist::MM"
$fmt ne "CPANPLUS::Dist::Build" $fmt ne "CPANPLUS::Dist::MM"
Truth table0%0/3
A and B
A= $fmt ne "CPANPLUS::Dist::Build"B= $fmt ne "CPANPLUS::Dist::MM"
ABresult
0X0
100
111
68 $fmt ne INSTALLER_MM;
69 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
70  
71 20 ▶use constant IS_CODEREF => sub { ref $_[-1] eq 'CODE' };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
72 386 ▶use constant IS_MODOBJ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
73 20 ▶ 'CPANPLUS::Module') };
Subroutine BEGIN: called CC=1 SCAR=0.0
74 7 ▶use constant IS_FAKE_MODOBJ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
75 20 ▶ 'CPANPLUS::Module::Fake') };
Subroutine BEGIN: called CC=1 SCAR=0.0
76 467 ▶use constant IS_AUTHOBJ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
77 20 ▶ 'CPANPLUS::Module::Author') };
Subroutine BEGIN: called CC=1 SCAR=0.0
78 use constant IS_FAKE_AUTHOBJ
79 1 ▶ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
80 20 ▶ 'CPANPLUS::Module::Author::Fake') };
Subroutine BEGIN: called CC=1 SCAR=0.0
81  
82 30 ▶use constant IS_CONFOBJ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
83 20 ▶ 'CPANPLUS::Configure') };
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 1 ▶use constant IS_RVOBJ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
86 20 ▶ 'CPANPLUS::Backend::RV') };
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 use constant IS_INTERNALS_OBJ
89 15 ▶ => sub { UNIVERSAL::isa($_[-1],
Subroutine __ANON__: called CC=1 SCAR=0.0
90 20 ▶ 'CPANPLUS::Internals') };
Subroutine BEGIN: called CC=1 SCAR=0.0
91  
92 20 ▶use constant IS_FILE => sub { return 1 if -e $_[-1] };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if -e $_[-1] 289 2 291
93  
94 use constant FILE_EXISTS => sub {
95 99 ▶ my $file = $_[-1];
Subroutine __ANON__: called CC=2 SCAR=10.1
96 99 ▶ return 1 if IS_FILE->($file);
Branch: 1 branch
BranchTrueFalseTotal
if sub { package CPANPLUS::Internals::Constants; use strict; return 1 if -e $_[-1];}->($file) 99 0 99
97 0 local $Carp::CarpLevel =
98 $Carp::CarpLevel+2;
99 0 error(loc( q[File '%1' does not exist],
100 $file));
101 0 return;
102 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 use constant FILE_READABLE => sub {
105 23 ▶ my $file = $_[-1];
Subroutine __ANON__: called CC=3 SCAR=16.0
106 23 ▶ return 1 if -e $file && -r _;
Branch: 1 branch
BranchTrueFalseTotal
if -e $file and -r _ 23 0 23
Condition33%1/3
-e $file and -r _
!ll&&!rl&&r
0023
MC/DC0%0/2
-e $file and -r _
-e $file -r _
Truth table33%1/3
A and B
A= -e $fileB= -r _
ABresult
0X0
100
111
107 0 local $Carp::CarpLevel =
108 $Carp::CarpLevel+2;
109 0 error( loc( q[File '%1' is not readable ].
110 q[or does not exist], $file));
111 0 return;
112 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
113 20 ▶use constant IS_DIR => sub { return 1 if -d $_[-1] };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if -d $_[-1] 85 5 90
114  
115 use constant DIR_EXISTS => sub {
116 73 ▶ my $dir = $_[-1];
Subroutine __ANON__: called CC=2 SCAR=6.9
117 73 ▶ return 1 if IS_DIR->($dir);
Branch: 1 branch
BranchTrueFalseTotal
if sub { package CPANPLUS::Internals::Constants; use strict; return 1 if -d $_[-1];}->($dir) 72 1 73
118 1 local $Carp::CarpLevel =
119 $Carp::CarpLevel+2;
120 1 error(loc(q[Dir '%1' does not exist],
121 $dir));
122 1 return;
123 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
124  
125 ### On VMS, if the $Config{make} is either MMK
126 ### or MMS, then the makefile is 'DESCRIP.MMS'.
127 use constant MAKEFILE => sub { my $file =
128 (ON_VMS and
129 32 ▶ $Config::Config{make} =~ /MM[S|K]/i)
Subroutine __ANON__: called CC=2 SCAR=6.9
130 ? 'DESCRIP.MMS'
131 : 'Makefile';
132  
133 return @_
134 32 ▶ ? File::Spec->catfile( @_, $file )
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 20 12 32
135 : $file;
136 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
137 use constant MAKEFILE_PL => sub { return @_
138 62 ▶ ? File::Spec->catfile( @_,
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 40 22 62
139 'Makefile.PL' )
140 : 'Makefile.PL';
141 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
142 use constant BUILD_PL => sub { return @_
143 21 ▶ ? File::Spec->catfile( @_,
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 19 2 21
144 'Build.PL' )
145 : 'Build.PL';
146 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
147  
148 use constant META_YML => sub { return @_
149 27 ▶ ? File::Spec->catfile( @_, 'META.yml' )
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 27 0 27
150 : 'META.yml';
151 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
152  
153 use constant MYMETA_YML => sub { return @_
154 3 ▶ ? File::Spec->catfile( @_, 'MYMETA.yml' )
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 3 0 3
155 : 'MYMETA.yml';
156 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
157  
158 use constant META_JSON => sub { return @_
159 21 ▶ ? File::Spec->catfile( @_, 'META.json' )
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 21 0 21
160 : 'META.json';
161 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
162  
163 use constant MYMETA_JSON => sub { return @_
164 3 ▶ ? File::Spec->catfile( @_, 'MYMETA.json' )
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 3 0 3
165 : 'MYMETA.json';
166 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
167  
168 use constant BLIB => sub { return @_
169 59 ▶ ? File::Spec->catfile(@_, 'blib')
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 58 1 59
170 : 'blib';
171 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
172  
173 20 ▶use constant LIB => 'lib';
Subroutine BEGIN: called CC=1 SCAR=0.0
174 use constant LIB_DIR => sub { return @_
175 7 ▶ ? File::Spec->catdir(@_, LIB)
Subroutine __ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 7 0 7
176 : LIB;
177 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
178 20 ▶use constant AUTO => 'auto';
Subroutine BEGIN: called CC=1 SCAR=0.0
179 use constant LIB_AUTO_DIR => sub { return @_
180 0 ▶ ? File::Spec->catdir(@_, LIB, AUTO)
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
181 : File::Spec->catdir(LIB, AUTO)
182 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
183 20 ▶use constant ARCH => 'arch';
Subroutine BEGIN: called CC=1 SCAR=0.0
184 use constant ARCH_DIR => sub { return @_
185 0 ▶ ? File::Spec->catdir(@_, ARCH)
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
186 : ARCH;
187 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
188 use constant ARCH_AUTO_DIR => sub { return @_
189 0 ▶ ? File::Spec->catdir(@_,ARCH,AUTO)
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
190 : File::Spec->catdir(ARCH,AUTO)
191 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
192  
193 use constant BLIB_LIBDIR => sub { return @_
194 0 ▶ ? File::Spec->catdir(
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
195 @_, BLIB->(), LIB )
196 : File::Spec->catdir( BLIB->(), LIB );
197 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
198  
199 20 ▶use constant BIN => 'bin';
Subroutine BEGIN: called CC=1 SCAR=0.0
200  
201 20 ▶use constant SCRIPT => 'script';
Subroutine BEGIN: called CC=1 SCAR=0.0
202  
203 use constant CONFIG_USER_LIB_DIR => sub {
204 0 ▶ require CPANPLUS::Internals::Utils;
Subroutine __ANON__: not called CC=1 SCAR=6.9
205 0 LIB_DIR->(
206 CPANPLUS::Internals::Utils->_home_dir,
207 DOT_CPANPLUS
208 );
209 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
210 use constant CONFIG_USER_FILE => sub {
211 0 ▶ File::Spec->catfile(
Subroutine __ANON__: not called CC=1 SCAR=6.9
212 CONFIG_USER_LIB_DIR->(),
213 split('::', CONFIG_USER),
214 ) . '.pm';
215 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
216 use constant CONFIG_SYSTEM_FILE => sub {
217 0 ▶ require CPANPLUS::Internals;
Subroutine __ANON__: not called CC=1 SCAR=6.9
218 0 require File::Basename;
219 my $dir = File::Basename::dirname(
220 0 $INC{'CPANPLUS/Internals.pm'}
221 );
222  
223 ### XXX use constants
224 0 File::Spec->catfile(
225 $dir, qw[Config System.pm]
226 );
227 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
228  
229 2 ▶use constant README => sub { my $obj = $_[0];
Subroutine __ANON__: called CC=1 SCAR=0.0
230 2 my $pkg = $obj->package_name;
231 2 $pkg .= '-' . $obj->package_version .
232 '.readme';
233 2 return $pkg;
234 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
235 20 ▶use constant META_EXT => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
236  
237 1 ▶use constant META => sub { my $obj = $_[0];
Subroutine __ANON__: called CC=1 SCAR=0.0
238 1 my $pkg = $obj->package_name;
239 1 $pkg .= '-' . $obj->package_version .
240 '.' . META_EXT;
241 1 return $pkg;
242 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
243  
244 use constant OPEN_FILE => sub {
245 93 ▶ my($file, $mode) = (@_, '');
Subroutine __ANON__: called CC=3 SCAR=12.0
246 93 my $fh;
247 93 ▶ open $fh, "$mode" . $file
Branch: 1 branch
BranchTrueFalseTotal
open $fh, "$mode" . $file or error(loc("Could not open file '%1': %2", $file, $!)) 0 93 93
248 or error(loc(
249 "Could not open file '%1': %2",
250 $file, $!));
251 93 ▶ return $fh if $fh;
Branch: 1 branch
BranchTrueFalseTotal
if $fh 93 0 93
252 0 return;
253 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
254  
255 use constant OPEN_DIR => sub {
256 7 ▶ my $dir = shift;
Subroutine __ANON__: called CC=3 SCAR=12.0
257 7 my $dh;
258 7 ▶ opendir $dh, $dir or error(loc(
Branch: 1 branch
BranchTrueFalseTotal
opendir $dh, $dir or error(loc("Could not open dir '%1': %2", $dir, $!)) 0 7 7
259 "Could not open dir '%1': %2", $dir, $!
260 ));
261  
262 7 ▶ return $dh if $dh;
Branch: 1 branch
BranchTrueFalseTotal
if $dh 7 0 7
263 0 return;
264 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
265  
266 use constant READ_DIR => sub {
267 7 ▶ my $dir = shift;
Subroutine __ANON__: called CC=2 SCAR=7.0
268 7 ▶ my $dh = OPEN_DIR->( $dir ) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $dh = sub { package CPANPLUS::Internals::Constants; use strict; my $dir = shift(); my $dh; opendir $dh, $dir or error(loc(q[Could not open dir '%1': %2], $dir, $!)); return $dh if $dh; return;}->($dir) or return 0 7 7
269  
270 ### exclude . and ..
271 7 my @files = grep { $_ !~ /^\.{1,2}/ }
272 readdir($dh);
273  
274 ### Remove trailing dot on VMS when
275 ### using VMS syntax.
276 7 if( ON_VMS ) {
277 s/(?<!\^)\.$// for @files;
278 }
279  
280 7 return @files;
281 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
282  
283 use constant STRIP_GZ_SUFFIX
284 => sub {
285 62 ▶ my $file = $_[0] or return;
Subroutine __ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
my $file = $_[0] or return 0 62 62
286 62 $file =~ s/.gz$//i;
287 62 return $file;
288 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
289  
290 20 ▶use constant CHECKSUMS => 'CHECKSUMS';
Subroutine BEGIN: called CC=1 SCAR=0.0
291 20 ▶use constant PGP_HEADER => '-----BEGIN PGP SIGNED MESSAGE-----';
Subroutine BEGIN: called CC=1 SCAR=0.0
292 20 use constant ENV_CPANPLUS_CONFIG
293 20 ▶ => 'PERL5_CPANPLUS_CONFIG';
Subroutine BEGIN: called CC=1 SCAR=0.0
294 20 use constant ENV_CPANPLUS_IS_EXECUTING
295 20 ▶ => 'PERL5_CPANPLUS_IS_EXECUTING';
Subroutine BEGIN: called CC=1 SCAR=0.0
296 20 ▶use constant DEFAULT_EMAIL => 'cpanplus@example.com';
Subroutine BEGIN: called CC=1 SCAR=0.0
297 use constant CPANPLUS_UA => sub { ### for the version number ###
298 0 ▶ require CPANPLUS::Internals;
Subroutine __ANON__: not called CC=1 SCAR=6.9
299 0 "CPANPLUS/$CPANPLUS::Internals::VERSION"
300 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
301 use constant TESTERS_URL => sub {
302 0 ▶ 'http://cpantesters.org/distro/'.
Subroutine __ANON__: not called CC=1 SCAR=6.9
303 uc(substr($_[0],0,1)) .'/'. $_[0] . '.yaml';
304 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
305 use constant TESTERS_DETAILS_URL
306 => sub {
307 0 ▶ 'http://cpantesters.org/distro/'.
Subroutine __ANON__: not called CC=1 SCAR=6.9
308 uc(substr($_[0],0,1)) .'/'. $_[0];
309 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
310  
311 use constant CREATE_FILE_URI
312 => sub {
313 66 ▶ my $dir = $_[0] or return;
Subroutine __ANON__: called CC=3 SCAR=12.0
Branch: 1 branch
BranchTrueFalseTotal
my $dir = $_[0] or return 0 66 66
314 66 ▶ return $dir =~ m|^/|
Branch: 1 branch
BranchTrueFalseTotal
$dir =~ m[^/] ? : 66 0 66
315 ? 'file://' . $dir
316 : 'file:///' . $dir;
317 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
318  
319 20 ▶use constant EMPTY_DSLIP => ' ';
Subroutine BEGIN: called CC=1 SCAR=0.0
320  
321 20 use constant CUSTOM_AUTHOR_ID
322 20 ▶ => 'LOCAL';
Subroutine BEGIN: called CC=1 SCAR=0.0
323  
324 20 use constant DOT_SHELL_DEFAULT_RC
325 20 ▶ => '.shell-default.rc';
Subroutine BEGIN: called CC=1 SCAR=0.0
326  
327 20 use constant SOURCE_SQLITE_DB
328 20 ▶ => 'db.sql';
Subroutine BEGIN: called CC=1 SCAR=0.0
329  
330 20 ▶use constant PREREQ_IGNORE => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
331 20 ▶use constant PREREQ_INSTALL => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
332 20 ▶use constant PREREQ_ASK => 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
333 20 ▶use constant PREREQ_BUILD => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
334 20 ▶use constant BOOLEANS => [0,1];
Subroutine BEGIN: called CC=1 SCAR=0.0
335 use constant CALLING_FUNCTION
336 1 ▶ => sub { my $lvl = $_[0] || 0;
Subroutine __ANON__: called CC=2 SCAR=7.2
Condition50%1/2
$_[0] || 0
l!l
01
MC/DC0%0/1
$_[0] || 0
$_[0]
Truth table50%1/2
A
A= $_[0]
Aresult
11
00
337 1 return join '::', (caller(2+$lvl))[3]
338 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
339 20 ▶use constant PERL_CORE => 'perl';
Subroutine BEGIN: called CC=1 SCAR=0.0
340 20 ▶use constant PERL_WRAPPER => 'use strict; BEGIN { my $old = select STDERR; $|++; select $old; $|++; $0 = shift(@ARGV); my $rv = do($0); die $@ if $@; }';
Subroutine BEGIN: called CC=1 SCAR=0.0
341 20 ▶use constant STORABLE_EXT => '.stored';
Subroutine BEGIN: called CC=1 SCAR=0.0
342  
343 0 ▶use constant GET_XS_FILES => sub { my $dir = $_[0] or return;
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
my $dir = $_[0] or return 0 0 0
344 0 require File::Find;
345 0 my @files;
346 File::Find::find(
347 0 ▶ sub { push @files, $File::Find::name
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
if $File::Find::name =~ /\.xs$/i 0 0 0
348 if $File::Find::name =~ /\.xs$/i
349 0 }, $dir );
350  
351 0 return @files;
352 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
353  
354 use constant INSTALL_LOG_FILE
355 0 ▶ => sub { my $obj = shift or return;
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
my $obj = shift() or return 0 0 0
356 0 my $name = $obj->name; $name =~ s/::/-/g;
357 0 $name .= '-'. $obj->version;
358 0 $name .= '-'. scalar(time) . '.log';
359 0 return $name;
360 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
361  
362 20 use constant ON_OLD_CYGWIN => do { ON_CYGWIN and $] < 5.008
363 ? loc(
364 "Your perl version for %1 is too low; ".
365 "Require %2 or higher for this function",
366 $^O, '5.8.0' )
367 : '';
368 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
369  
370 ### XXX these 2 are probably obsolete -- check & remove;
371 20 ▶use constant DOT_EXISTS => '.exists';
Subroutine BEGIN: called CC=1 SCAR=0.0
372  
373 use constant QUOTE_PERL_ONE_LINER
374 0 ▶ => sub { my $line = shift or return;
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
my $line = shift() or return 0 0 0
375  
376 ### use double quotes on these systems
377 0 return qq["$line"]
378 if ON_WIN32 || ON_NETWARE || ON_VMS;
379  
380 ### single quotes on the rest
381 0 return qq['$line'];
382 20 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
383  
384 20 1;
385  
386 # Local variables:
387 # c-indentation-style: bsd
388 # c-basic-offset: 4
389 # indent-tabs-mode: nil
390 # End:
391 # vim: expandtab shiftwidth=4:
« lib/CPANPLUS/Module/Author/Fake.pm ↑ Summary blib/lib/CPANPLUS/Backend/RV.pm »