line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Module::Install::Any::Moose; |
3
|
1
|
|
|
1
|
|
1311
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
54
|
|
4
|
1
|
|
|
1
|
|
671
|
use Module::Install::Base; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
7
|
use vars qw($VERSION @ISA $ISCORE); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
91
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
1
|
|
|
1
|
|
2
|
$VERSION = '0.00003'; |
9
|
1
|
|
|
|
|
3
|
$ISCORE = 0; |
10
|
1
|
|
|
|
|
605
|
@ISA = qw(Module::Install::Base); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub requires_any_moose { |
14
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
my ($module, %args); |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
if (@_ % 2 == 0) { |
18
|
0
|
|
|
|
|
|
%args = @_; |
19
|
|
|
|
|
|
|
} else { |
20
|
0
|
|
|
|
|
|
($module, %args) = @_; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
0
|
|
|
|
my $prefer = ($args{prefer} ||= 'Mouse'); |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $requires = $self->requires; |
26
|
0
|
0
|
|
|
|
|
if (! grep { $_->[0] eq 'Any::Moose' } @$requires ) { |
|
0
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
print "Adding Any::Moose to prerequisites...\n"; |
28
|
0
|
|
|
|
|
|
$self->requires('Any::Moose', 0.04); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$self->_any_moose_setup($prefer, $module, %args); |
32
|
0
|
0
|
|
|
|
|
$self->_any_moose_setup( |
33
|
|
|
|
|
|
|
($prefer eq 'Mouse' ? 'Moose' : 'Mouse'), $module, %args ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _any_moose_setup { |
37
|
0
|
|
|
0
|
|
|
my ($self, $prefix, $frag, %args) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
my $module = $frag ? $prefix . $frag : $prefix; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $prefer = $args{ prefer }; |
42
|
0
|
|
|
|
|
|
my $version = $args{ lc $prefix }; |
43
|
0
|
0
|
|
|
|
|
if ($prefer eq $prefix) { |
44
|
0
|
|
|
|
|
|
$self->requires($module, $version); |
45
|
|
|
|
|
|
|
} else { |
46
|
0
|
|
|
|
|
|
print "[Any::Moose support for $module]\n", |
47
|
|
|
|
|
|
|
"- $module ... "; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# ripped out of ExtUtils::MakeMaker |
50
|
0
|
|
|
|
|
|
my $file = "$module.pm"; |
51
|
0
|
|
|
|
|
|
$file =~ s{::}{/}g; |
52
|
0
|
|
|
|
|
|
eval { require $file }; |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
0
|
|
0
|
|
|
|
my $pr_version = $module->VERSION || 0; |
55
|
0
|
|
|
|
|
|
$pr_version =~ s/(\d+)\.(\d+)_(\d+)/$1.$2$3/; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
if ($@) { |
58
|
0
|
|
|
|
|
|
print "missing\n"; |
59
|
0
|
|
|
|
|
|
my $y_n = ExtUtils::MakeMaker::prompt(" Add $module to the prerequisites?", 'n'); |
60
|
0
|
0
|
|
|
|
|
if ($y_n =~ /^y(?:es)?$/i) { |
61
|
0
|
|
|
|
|
|
$self->requires($module, $version); |
62
|
|
|
|
|
|
|
} else { |
63
|
0
|
|
|
|
|
|
$self->recommends($module, $version); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} else { |
66
|
0
|
|
|
|
|
|
print "loaded ($pr_version)\n"; |
67
|
0
|
|
|
|
|
|
$self->recommends($module, $version); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |