lib/Module/Install/With.pm

filter: Statementstmt 61.9% 13 / 21 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 33.3% 4 / 12 Podpod 62.5% 5 / 8 totaltotal 43.1% 22 / 51 CC 3 SCAR 10.5
CC
3
Cov
48%
interactive
6.0
winlike
6.0
eumm
2.0
CRAP 2.9
« lib/Module/Install/Compiler.pm ↑ Summary lib/Module/Install/Admin/Compiler.pm »
1 package Module::Install::With;
2  
3 # See POD at end for docs
4  
5 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 46 ▶use Module::Install::Base ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 46 ▶use vars qw{$VERSION @ISA $ISCORE};
Subroutine BEGIN: called CC=1 SCAR=0.0
9 46 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
10 46 $VERSION = '1.21';
11 46 @ISA = 'Module::Install::Base';
12 46 $ISCORE = 1;
13 }
14  
15 =pod
16  
17 =head1 NAME
18  
19 Module::Install::With - find environnement for Module::Install
20  
21 =cut
22  
23 #####################################################################
24 # Installer Target
25  
26 # Are we targeting ExtUtils::MakeMaker (running as Makefile.PL)
27 0 ▶sub eumm {
Subroutine eumm: not called CC=1 SCAR=6.9
Pod undocumented
28 0 !! ($0 =~ /Makefile.PL$/i);
29 }
30  
31 # You should not be using this, but we'll keep the hook anyways
32 0 ▶sub mb {
Subroutine mb: not called CC=1 SCAR=6.9
Pod undocumented
33 0 !! ($0 =~ /Build.PL$/i);
34 }
35  
36  
37  
38  
39  
40 #####################################################################
41 # Testing and Configuration Contexts
42  
43 =pod
44  
45 =head2 interactive
46  
47 The C<interactive> function tests for an install that has a user present
48 (or at least, one in which it is reasonable for us to present prompts
49 and other similar types of things).
50  
51 Returns true if in an interactive environment, or false otherwise.
52  
53 =cut
54  
55 0 ▶sub interactive {
Subroutine interactive: not called CC=2 SCAR=17.9
Pod documented
56 # Treat things interactively ONLY based on input
57 0 ▶ !! (-t STDIN and ! automated_testing());
Condition0%0/3
-t STDIN && !automated_testing()
!ll&&!rl&&r
000
MC/DC0%0/2
-t STDIN && !automated_testing()
-t STDIN !automated_testing()
Truth table0%0/3
A && not(B)
A= -t STDINB= !automated_testing()
ABresult
0X0
100
111
58 }
59  
60 =pod
61  
62 =head2 automated_testing
63  
64 Are we currently running in an automated testing environment, such as
65 CPAN Testers.
66  
67 This is primarily a cleaner and more human-readable equivalent of
68 checking $ENV{AUTOMATED_TESTING} yourself, but may be improved in line
69 with best practices at a later date.
70  
71 =cut
72  
73 0 ▶sub automated_testing {
Subroutine automated_testing: not called CC=1 SCAR=6.9
Pod documented
74 0 !! $ENV{AUTOMATED_TESTING};
75 }
76  
77 =pod
78  
79 =head2 release_testing
80  
81 Are we currently running in an release testing environment. That is,
82 are we in the process of running in a potential highly-intensive and
83 high dependency bloat testing process prior to packaging a module for
84 release.
85  
86 This is primarily a cleaner and more human-readable equivalent of
87 checking $ENV{RELEASE_TESTING} yourself, but may be improved in line
88 with best practices at a later date.
89  
90 =cut
91  
92 0 ▶sub release_testing {
Subroutine release_testing: not called CC=1 SCAR=6.9
Pod documented
93 0 !! $ENV{RELEASE_TESTING};
94 }
95  
96 0 ▶sub author_context {
Subroutine author_context: not called CC=1 SCAR=6.9
Pod undocumented
97 0 !! $Module::Install::AUTHOR;
98 }
99  
100  
101  
102  
103  
104 #####################################################################
105 # Operating System Convenience
106  
107 =pod
108  
109 =head2 win32
110  
111 The C<win32> function tests if the Makefile.PL is currently running in a
112 native Microsoft Windows Perl, such as ActivePerl or Strawberry Perl.
113  
114 This is primarily a cleaner and more human-readable equivalent of
115 checking C<$^O eq 'MSWin32'> yourself, but may be improved in line
116 with best practices at a later date.
117  
118 =cut
119  
120 0 ▶sub win32 {
Subroutine win32: not called CC=1 SCAR=6.9
Pod documented
121 0 !! ($^O eq 'MSWin32');
122 }
123  
124 =pod
125  
126 =head2 winlike
127  
128 The C<winlike> function tests if the Makefile.PL is currently running
129 in a Microsoft Windows Perl, under either cygwin or a native Win32 Perl.
130  
131 This is primarily a cleaner and more human-readable equivalent of
132 checking C<$^O eq 'MSWin32' or $^O eq 'cygwin'>yourself, but may be
133 improved in line with best practices at a later date.
134  
135 =cut
136  
137 0 ▶sub winlike {
Subroutine winlike: not called CC=2 SCAR=17.9
Pod documented
138 0 ▶ !! ($^O eq 'MSWin32' or $^O eq 'cygwin');
Condition0%0/3
$^O eq 'MSWin32' || $^O eq 'cygwin'
l!l&&r!l&&!r
000
MC/DC0%0/2
$^O eq 'MSWin32' || $^O eq 'cygwin'
$^O eq 'MSWin32' $^O eq 'cygwin'
Truth table0%0/3
A || B
A= $^O eq 'MSWin32'B= $^O eq 'cygwin'
ABresult
1X1
011
000
139 }
140  
141 46 1;
142  
143 =pod
144  
145 =head1 SEE ALSO
146  
147 L<Module::Install>
148  
149 =head1 AUTHORS
150  
151 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
152  
153 =head1 COPYRIGHT
154  
155 Copyright 2007 - 2012 Adam Kennedy.
156  
157 This program is free software; you can redistribute
158 it and/or modify it under the same terms as Perl itself.
159  
160 The full text of the license can be found in the
161 LICENSE file included with this module.
162  
163 =cut
« lib/Module/Install/Compiler.pm ↑ Summary lib/Module/Install/Admin/Compiler.pm »