line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::LatestPrereqs::ModuleInstall;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1550
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings;
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
5
|
use Carp;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
75
|
|
6
|
1
|
|
|
1
|
|
6
|
use File::Spec;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
7
|
1
|
|
|
1
|
|
64
|
use Config;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
42
|
|
8
|
1
|
|
|
1
|
|
1125
|
use File::Find::Rule;
|
|
1
|
|
|
|
|
9093
|
|
|
1
|
|
|
|
|
12
|
|
9
|
1
|
|
|
1
|
|
1107
|
use Class::Inspector;
|
|
1
|
|
|
|
|
4958
|
|
|
1
|
|
|
|
|
79
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %ignorable_mi_methods = map { $_ => 1 } qw(
|
12
|
|
|
|
|
|
|
autoload call import new load load_extensions
|
13
|
|
|
|
|
|
|
preload find_extensions AUTOLOAD DESTROY
|
14
|
|
|
|
|
|
|
);
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub parse {
|
17
|
0
|
|
|
0
|
1
|
|
my ($class, $file) = @_;
|
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my @requires;
|
20
|
1
|
|
|
1
|
|
9
|
no warnings 'redefine';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
638
|
|
21
|
0
|
|
|
|
|
|
local $INC{'inc/Module/Install.pm'} = 1;
|
22
|
0
|
|
|
|
|
|
local $INC{'Module/Install/Base.pm'} = 1;
|
23
|
0
|
|
|
|
|
|
local $inc::Module::Install::VERSION = '666'; # cheat version check
|
24
|
0
|
|
|
0
|
|
|
local *inc::Module::Install::AUTOLOAD = sub { 1 };
|
|
0
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
local @inc::Module::Install::EXPORT = _get_methods();
|
26
|
0
|
|
|
|
|
|
local @inc::Module::Install::ISA = 'Exporter';
|
27
|
|
|
|
|
|
|
local *inc::Module::Install::requires = sub {
|
28
|
0
|
0
|
|
0
|
|
|
my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_);
|
29
|
0
|
|
0
|
|
|
|
push @requires, [ $_, $deps{$_} || 0 ] for keys %deps;
|
30
|
0
|
|
|
|
|
|
};
|
31
|
|
|
|
|
|
|
local *inc::Module::Install::build_requires = sub {
|
32
|
0
|
0
|
|
0
|
|
|
my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_);
|
33
|
0
|
|
0
|
|
|
|
push @requires, [ $_, $deps{$_} || 0 ] for keys %deps;
|
34
|
0
|
|
|
|
|
|
};
|
35
|
|
|
|
|
|
|
local *inc::Module::Install::test_requires = sub {
|
36
|
0
|
0
|
|
0
|
|
|
my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_);
|
37
|
0
|
|
0
|
|
|
|
push @requires, [ $_, $deps{$_} || 0 ] for keys %deps;
|
38
|
0
|
|
|
|
|
|
};
|
39
|
|
|
|
|
|
|
local *inc::Module::Install::recommends = sub {
|
40
|
0
|
0
|
|
0
|
|
|
my %deps = (@_ == 1 ? ( $_[0] => 0 ) : @_);
|
41
|
0
|
|
0
|
|
|
|
push @requires, [ $_, $deps{$_} || 0 ] for keys %deps;
|
42
|
0
|
|
|
|
|
|
};
|
43
|
|
|
|
|
|
|
local *inc::Module::Install::feature = sub {
|
44
|
0
|
|
|
0
|
|
|
my $name = shift;
|
45
|
0
|
|
|
|
|
|
while ( @_ ) {
|
46
|
0
|
|
|
|
|
|
my $key = shift;
|
47
|
0
|
0
|
|
|
|
|
if ( $key =~ /^\-/ ) { shift; next } # option
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
48
|
0
|
0
|
0
|
|
|
|
if ( $key && !ref $key ) {
|
49
|
0
|
|
0
|
|
|
|
push @requires, [ $key, shift || 0 ];
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
}
|
52
|
0
|
|
|
|
|
|
};
|
53
|
|
|
|
|
|
|
local *inc::Module::Install::features = sub {
|
54
|
0
|
|
|
0
|
|
|
my %features = @_;
|
55
|
0
|
|
|
|
|
|
while ( my ($name, $arrayref) = each %features ) {
|
56
|
0
|
|
|
|
|
|
inc::Module::Install::feature( $name, @$arrayref );
|
57
|
|
|
|
|
|
|
}
|
58
|
0
|
|
|
|
|
|
};
|
59
|
0
|
|
|
|
|
|
local *inc::Module::Install::include_deps = *inc::Module::Install::requires;
|
60
|
0
|
|
|
0
|
|
|
local *inc::Module::Install::Makefile = sub { 'Test::LatestPrereqs::ModuleInstall::Fake' };
|
|
0
|
|
|
|
|
|
|
61
|
0
|
|
|
0
|
|
|
local *inc::Module::Install::Meta = sub { 'Test::LatestPrereqs::ModuleInstall::Fake' };
|
|
0
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
eval {
|
64
|
|
|
|
|
|
|
package main;
|
65
|
1
|
|
|
1
|
|
6
|
no strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
66
|
1
|
|
|
1
|
|
5
|
no warnings;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
576
|
|
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
|
|
local *CORE::GLOBAL::exit = sub {};
|
|
0
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
require "$file";
|
71
|
|
|
|
|
|
|
};
|
72
|
0
|
|
|
|
|
|
delete $INC{$file};
|
73
|
|
|
|
|
|
|
|
74
|
0
|
0
|
0
|
|
|
|
if ($@ && $@ !~ /did not return a true value/) {
|
75
|
0
|
|
|
|
|
|
croak "Makefile.PL error: $@";
|
76
|
|
|
|
|
|
|
}
|
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return @requires;
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub _get_methods {
|
82
|
0
|
|
|
0
|
|
|
my $dir = 'inc/Module/Install';
|
83
|
0
|
0
|
|
|
|
|
unless (-d $dir) {
|
84
|
0
|
|
|
|
|
|
$dir = File::Spec->catdir( $Config{sitelib}, 'Module/Install' );
|
85
|
0
|
|
|
|
|
|
$dir =~ s{\\}{/}g;
|
86
|
|
|
|
|
|
|
}
|
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
my @methods;
|
89
|
0
|
|
|
|
|
|
foreach my $file ( File::Find::Rule->file->name('*.pm')->in($dir) ) {
|
90
|
0
|
|
|
|
|
|
eval {
|
91
|
0
|
|
|
|
|
|
require File::Spec->rel2abs($file);
|
92
|
0
|
|
|
|
|
|
my %seen;
|
93
|
0
|
|
0
|
|
|
|
@methods = grep { !$seen{$_}++ && !$ignorable_mi_methods{$_} }
|
|
0
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
@methods,
|
95
|
0
|
|
|
|
|
|
@{ Class::Inspector->methods( _file_to_mod( $file ), 'public' ) };
|
96
|
0
|
|
|
|
|
|
delete $INC{$file};
|
97
|
|
|
|
|
|
|
};
|
98
|
0
|
0
|
|
|
|
|
warn "inspecting error: $@" if $@;
|
99
|
|
|
|
|
|
|
}
|
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
return @methods;
|
102
|
|
|
|
|
|
|
}
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub _file_to_mod {
|
105
|
0
|
|
|
0
|
|
|
my $file = shift;
|
106
|
0
|
|
|
|
|
|
$file =~ s{\\}{/}g;
|
107
|
0
|
|
|
|
|
|
$file =~ s{^.+/Module/Install}{Module/Install};
|
108
|
0
|
|
|
|
|
|
$file =~ s{/}{::}g;
|
109
|
0
|
|
|
|
|
|
$file =~ s{\.pm}{};
|
110
|
0
|
|
|
|
|
|
$file;
|
111
|
|
|
|
|
|
|
}
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
package #
|
114
|
|
|
|
|
|
|
Test::LatestPrereqs::ModuleInstall::Fake;
|
115
|
0
|
|
|
0
|
|
|
sub write {}
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1;
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__END__
|