line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::list; |
2
|
|
|
|
|
|
|
$Tangerine::hook::list::VERSION = '0.19'; |
3
|
15
|
|
|
15
|
|
1097
|
use 5.010; |
|
15
|
|
|
|
|
43
|
|
4
|
15
|
|
|
15
|
|
65
|
use strict; |
|
15
|
|
|
|
|
22
|
|
|
15
|
|
|
|
|
329
|
|
5
|
15
|
|
|
15
|
|
71
|
use warnings; |
|
15
|
|
|
|
|
23
|
|
|
15
|
|
|
|
|
427
|
|
6
|
15
|
|
|
15
|
|
58
|
use parent 'Tangerine::Hook'; |
|
15
|
|
|
|
|
21
|
|
|
15
|
|
|
|
|
68
|
|
7
|
15
|
|
|
15
|
|
859
|
use List::MoreUtils qw(any); |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
109
|
|
8
|
15
|
|
|
15
|
|
4716
|
use Tangerine::HookData; |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
286
|
|
9
|
15
|
|
|
15
|
|
60
|
use Tangerine::Occurence; |
|
15
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
365
|
|
10
|
15
|
|
|
15
|
|
68
|
use Tangerine::Utils qw(stripquotelike); |
|
15
|
|
|
|
|
18
|
|
|
15
|
|
|
|
|
7331
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub run { |
13
|
132
|
|
|
132
|
1
|
161
|
my ($self, $s) = @_; |
14
|
132
|
100
|
100
|
185
|
|
506
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && |
|
185
|
|
100
|
|
|
765
|
|
15
|
474
|
|
|
474
|
|
9051
|
(any { $s->[1] eq $_ } qw(aliased base mixin::with Mojo::Base ok parent superclass))) { |
16
|
15
|
|
|
|
|
133
|
my ($version) = $s->[2] =~ /^(\d.*)$/o; |
17
|
15
|
|
50
|
|
|
80
|
$version //= ''; |
18
|
15
|
50
|
|
|
|
26
|
my $voffset = $version ? 3 : 2; |
19
|
15
|
|
|
|
|
13
|
my @args; |
20
|
15
|
50
|
|
|
|
26
|
if (scalar(@$s) > $voffset) { |
21
|
15
|
100
|
|
|
|
35
|
return if $s->[$voffset] eq ';'; |
22
|
14
|
|
|
|
|
123
|
@args = @$s; |
23
|
14
|
|
|
|
|
39
|
@args = @args[($voffset) .. $#args]; |
24
|
14
|
|
|
|
|
38
|
@args = stripquotelike(@args); |
25
|
10
|
|
|
|
|
41
|
@args = grep { !/^-norequire$/ } @args |
26
|
14
|
100
|
|
26
|
|
50
|
if any { $s->[1] eq $_ } qw/parent superclass/; |
|
26
|
|
|
|
|
141
|
|
27
|
14
|
100
|
|
|
|
107
|
@args = grep { !/^-(base|strict)$/ } @args |
|
3
|
|
|
|
|
32
|
|
28
|
|
|
|
|
|
|
if $s->[1] eq 'Mojo::Base'; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
@args = $args[0] |
31
|
14
|
100
|
100
|
39
|
|
130
|
if $args[0] && any { $s->[1] eq $_ } qw/aliased mixin::with Mojo::Base ok/; |
|
39
|
|
|
|
|
181
|
|
32
|
14
|
|
|
|
|
107
|
my %found; |
33
|
14
|
|
|
|
|
34
|
for (my $i = 0; $i < scalar(@args); $i++) { |
34
|
15
|
|
|
|
|
32
|
$found{$args[$i]} = ''; |
35
|
15
|
100
|
100
|
|
|
62
|
if ($args[$i+1] && $args[$i+1] =~ /^v?\d+(\.\d+)*$/) { |
36
|
1
|
|
|
|
|
2
|
$found{$args[$i]} = $args[$i+1]; |
37
|
1
|
|
|
|
|
4
|
$i++ |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
return Tangerine::HookData->new( |
41
|
|
|
|
|
|
|
modules => { |
42
|
|
|
|
|
|
|
map { |
43
|
14
|
|
|
|
|
37
|
( $_ => Tangerine::Occurence->new(version => $found{$_}) ) |
|
15
|
|
|
|
|
41
|
|
44
|
|
|
|
|
|
|
} keys %found, |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
} |
48
|
117
|
|
|
|
|
1297
|
return; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |