line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::list; |
2
|
|
|
|
|
|
|
$Tangerine::hook::list::VERSION = '0.20'; |
3
|
15
|
|
|
15
|
|
1345
|
use 5.010; |
|
15
|
|
|
|
|
47
|
|
4
|
15
|
|
|
15
|
|
72
|
use strict; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
300
|
|
5
|
15
|
|
|
15
|
|
67
|
use warnings; |
|
15
|
|
|
|
|
27
|
|
|
15
|
|
|
|
|
370
|
|
6
|
15
|
|
|
15
|
|
79
|
use parent 'Tangerine::Hook'; |
|
15
|
|
|
|
|
25
|
|
|
15
|
|
|
|
|
79
|
|
7
|
15
|
|
|
15
|
|
989
|
use List::Util 1.33 qw(any); |
|
15
|
|
|
|
|
287
|
|
|
15
|
|
|
|
|
934
|
|
8
|
15
|
|
|
15
|
|
77
|
use Tangerine::HookData; |
|
15
|
|
|
|
|
25
|
|
|
15
|
|
|
|
|
489
|
|
9
|
15
|
|
|
15
|
|
81
|
use Tangerine::Occurence; |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
365
|
|
10
|
15
|
|
|
15
|
|
129
|
use Tangerine::Utils qw(stripquotelike $vre); |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
10548
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub run { |
13
|
136
|
|
|
136
|
1
|
215
|
my ($self, $s) = @_; |
14
|
136
|
100
|
100
|
191
|
|
543
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && |
|
191
|
|
100
|
|
|
1163
|
|
15
|
550
|
|
|
550
|
|
6463
|
(any { $s->[1] eq $_ } |
16
|
|
|
|
|
|
|
qw(aliased base mixin::with Mojo::Base ok parent superclass |
17
|
|
|
|
|
|
|
Test::Class::Most))) { |
18
|
17
|
|
|
|
|
263
|
my ($version) = $s->[2] =~ $vre; |
19
|
17
|
|
50
|
|
|
145
|
$version //= ''; |
20
|
17
|
50
|
|
|
|
30
|
my $voffset = $version ? 3 : 2; |
21
|
17
|
|
|
|
|
18
|
my @args; |
22
|
17
|
50
|
|
|
|
41
|
if (scalar(@$s) > $voffset) { |
23
|
17
|
100
|
|
|
|
48
|
return if $s->[$voffset] eq ';'; |
24
|
16
|
|
|
|
|
215
|
@args = @$s; |
25
|
16
|
|
|
|
|
45
|
@args = @args[($voffset) .. $#args]; |
26
|
16
|
|
|
|
|
59
|
@args = stripquotelike(@args); |
27
|
10
|
|
|
|
|
59
|
@args = grep { !/^-norequire$/ } @args |
28
|
16
|
100
|
|
30
|
|
65
|
if any { $s->[1] eq $_ } qw/parent superclass/; |
|
30
|
|
|
|
|
240
|
|
29
|
16
|
100
|
|
|
|
204
|
@args = grep { !/^-(base|strict)$/ } @args |
|
3
|
|
|
|
|
41
|
|
30
|
|
|
|
|
|
|
if $s->[1] eq 'Mojo::Base'; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
@args = $args[0] |
33
|
16
|
100
|
100
|
47
|
|
222
|
if $args[0] && any { $s->[1] eq $_ } qw/aliased mixin::with Mojo::Base ok/; |
|
47
|
|
|
|
|
404
|
|
34
|
16
|
100
|
|
|
|
223
|
if ($s->[1] eq 'Test::Class::Most') { |
35
|
2
|
|
|
|
|
25
|
my $tcmparent; |
36
|
|
|
|
|
|
|
my @results; |
37
|
2
|
|
|
|
|
4
|
for my $arg (@args) { |
38
|
13
|
100
|
|
|
|
66
|
if ($tcmparent) { |
39
|
5
|
100
|
|
10
|
|
19
|
if (any { $arg eq $_ } qw/attributes is_abstract/) { |
|
10
|
|
|
|
|
30
|
|
40
|
1
|
|
|
|
|
13
|
undef $tcmparent; |
41
|
|
|
|
|
|
|
next |
42
|
1
|
|
|
|
|
4
|
} |
43
|
4
|
|
|
|
|
12
|
push @results, $arg |
44
|
|
|
|
|
|
|
} else { |
45
|
8
|
100
|
|
|
|
20
|
if ($arg eq 'parent') { |
46
|
3
|
|
|
|
|
47
|
$tcmparent++; |
47
|
|
|
|
|
|
|
undef @results |
48
|
3
|
|
|
|
|
6
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
@args = @results |
52
|
2
|
|
|
|
|
6
|
} |
53
|
16
|
|
|
|
|
168
|
my %found; |
54
|
16
|
|
|
|
|
46
|
for (my $i = 0; $i < scalar(@args); $i++) { |
55
|
18
|
|
|
|
|
50
|
$found{$args[$i]} = ''; |
56
|
18
|
100
|
100
|
|
|
108
|
if ($args[$i+1] && $args[$i+1] =~ /^v?\d+(?:\.\d+)*$/) { |
57
|
1
|
|
|
|
|
4
|
$found{$args[$i]} = $args[$i+1]; |
58
|
1
|
|
|
|
|
6
|
$i++ |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
return Tangerine::HookData->new( |
62
|
|
|
|
|
|
|
modules => { |
63
|
|
|
|
|
|
|
map { |
64
|
16
|
|
|
|
|
37
|
( $_ => Tangerine::Occurence->new(version => $found{$_}) ) |
|
18
|
|
|
|
|
63
|
|
65
|
|
|
|
|
|
|
} keys %found, |
66
|
|
|
|
|
|
|
}, |
67
|
|
|
|
|
|
|
); |
68
|
|
|
|
|
|
|
} |
69
|
119
|
|
|
|
|
1874
|
return; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |