« blib/lib/Perl/Critic/Policy/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.pm
↑ Summary
blib/lib/Perl/Critic/Policy/BuiltinFunctions/RequireBlockGrep.pm »
| 1 | #! /usr/local/bin/perl | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Cwd; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use File::Basename; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | sub magic_number_matches { | ||||||||||||||||||||||||||||
| 9 | 1 | ▶ | return 0 unless -e '_build/magicnum'; | ||||||||||||||||||||||||||
|
Subroutine
magic_number_matches: called CC=3 SCAR=11.2
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 10 | 1 | my $FH; | |||||||||||||||||||||||||||
| 11 | 1 | ▶ | open $FH, '<','_build/magicnum' or return 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | 1 | my $filenum = <$FH>; | |||||||||||||||||||||||||||
| 13 | 1 | close $FH; | |||||||||||||||||||||||||||
| 14 | 1 | return $filenum == 437469; | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 1 | my $progname; | |||||||||||||||||||||||||||
| 18 | my $orig_dir; | ||||||||||||||||||||||||||||
| 19 | BEGIN { | ||||||||||||||||||||||||||||
| 20 | 1 | ▶ | $^W = 1; # Use warnings | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=5 SCAR=20.9
| |||||||||||||||||||||||||||||
| 21 | 1 | $progname = basename($0); | |||||||||||||||||||||||||||
| 22 | 1 | $orig_dir = Cwd::cwd(); | |||||||||||||||||||||||||||
| 23 | 1 | my $base_dir = '/home/cpancover/.cpan/build/Perl-Critic-1.150-0'; | |||||||||||||||||||||||||||
| 24 | 1 | ▶ | if (!magic_number_matches()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | unless (chdir($base_dir)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 0 | die ("Couldn't chdir($base_dir), aborting\n"); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | unless (magic_number_matches()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | die ("Configuration seems to be out of date, please re-run 'perl Build.PL' again.\n"); | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | 1 | unshift @INC, | |||||||||||||||||||||||||||
| 33 | ( | ||||||||||||||||||||||||||||
| 34 | 'inc' | ||||||||||||||||||||||||||||
| 35 | ); | ||||||||||||||||||||||||||||
| 36 | 1 | ▶ | if ($INC[-1] ne '.') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 1 | push @INC, '.'; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 1 | ▶ | close(*DATA) unless eof(*DATA); # ensure no open handles to this script | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 1 | ▶ | use Perl::Critic::Module::Build; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 45 | 1 | Module::Build->VERSION(q{0.4204}); | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | # Some platforms have problems setting $^X in shebang contexts, fix it up here | ||||||||||||||||||||||||||||
| 48 | 1 | $^X = Module::Build->find_perl_interpreter; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 1 | ▶ | if (-e 'Build.PL' and not Perl::Critic::Module::Build->up_to_date('Build.PL', $progname)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
-e "Build.PL" and not "Perl::Critic::Module::Build"->up_to_date("Build.PL", $progname)
MC/DC0%0/2
-e "Build.PL" and not "Perl::Critic::Module::Build"->up_to_date("Build.PL", $progname)
-e "Build.PL"
not "Perl::Critic::Module::Build"->up_to_date("Build.PL", $progname)
Truth table33%1/3
A and not(B)
A= -e "Build.PL"B= not "Perl::Critic::Module::Build"->up_to_date("Build.PL", $progname)
| |||||||||||||||||||||||||||||
| 51 | 0 | warn "Warning: Build.PL has been altered. You may need to run 'perl Build.PL' again.\n"; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | # This should have just enough arguments to be able to bootstrap the rest. | ||||||||||||||||||||||||||||
| 55 | 1 | my $build = Perl::Critic::Module::Build->resume ( | |||||||||||||||||||||||||||
| 56 | properties => { | ||||||||||||||||||||||||||||
| 57 | config_dir => '_build', | ||||||||||||||||||||||||||||
| 58 | orig_dir => $orig_dir, | ||||||||||||||||||||||||||||
| 59 | }, | ||||||||||||||||||||||||||||
| 60 | ); | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 1 | $build->dispatch; | |||||||||||||||||||||||||||