| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
20
|
|
|
20
|
|
7918
|
use strict; |
|
|
20
|
|
|
|
|
36
|
|
|
|
20
|
|
|
|
|
740
|
|
|
2
|
20
|
|
|
20
|
|
84
|
use warnings; |
|
|
20
|
|
|
|
|
24
|
|
|
|
20
|
|
|
|
|
542
|
|
|
3
|
20
|
|
|
20
|
|
71
|
use utf8; |
|
|
20
|
|
|
|
|
34
|
|
|
|
20
|
|
|
|
|
125
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Daiku::Role; |
|
6
|
20
|
|
|
20
|
|
8965
|
use Mouse::Role; |
|
|
20
|
|
|
|
|
14724
|
|
|
|
20
|
|
|
|
|
62
|
|
|
7
|
20
|
|
|
20
|
|
3827
|
use Scalar::Util qw/blessed/; |
|
|
20
|
|
|
|
|
53
|
|
|
|
20
|
|
|
|
|
1238
|
|
|
8
|
20
|
|
|
20
|
|
91
|
use Carp (); |
|
|
20
|
|
|
|
|
27
|
|
|
|
20
|
|
|
|
|
5813
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'build'; |
|
11
|
|
|
|
|
|
|
requires 'match'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has registry => ( |
|
14
|
|
|
|
|
|
|
is => 'rw', |
|
15
|
|
|
|
|
|
|
isa => 'Maybe[Daiku::Registry]', |
|
16
|
|
|
|
|
|
|
weak_ref => 1, |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub clone { |
|
20
|
1
|
|
|
1
|
0
|
8
|
my $self = shift; |
|
21
|
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
1
|
my %args; |
|
23
|
1
|
|
|
|
|
6
|
for my $attr ($self->meta->get_attribute_list) { |
|
24
|
5
|
|
|
|
|
37
|
$args{$attr} = $self->$attr; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
1
|
|
|
|
|
3
|
return $self->meta->name->new(%args); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub log { |
|
30
|
184
|
|
|
184
|
0
|
256
|
my ($class, @msg) = @_; |
|
31
|
184
|
|
|
|
|
3438
|
print "[LOG] @msg\n"; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub debug { |
|
35
|
102
|
|
|
102
|
0
|
132
|
my ($class, @msg) = @_; |
|
36
|
102
|
50
|
|
|
|
295
|
print "[LOG][DBG] @msg\n" if $ENV{DAIKU_DEBUG}; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub merge { |
|
40
|
2
|
|
|
2
|
0
|
5
|
my ($self, $task) = @_; |
|
41
|
2
|
50
|
|
|
|
6
|
return unless $task; |
|
42
|
|
|
|
|
|
|
|
|
43
|
2
|
50
|
|
|
|
23
|
Carp::croak("Cannot merge defferent type task: $task") |
|
44
|
|
|
|
|
|
|
if blessed($self) ne blessed($task); |
|
45
|
|
|
|
|
|
|
|
|
46
|
2
|
50
|
|
|
|
21
|
if ($self->can('deps')) { |
|
47
|
2
|
|
|
|
|
3
|
unshift @{$self->deps}, @{$task->deps}; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
7
|
|
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
6
|
my $orig_code = $self->code(); |
|
51
|
2
|
|
|
|
|
5
|
my $other_code = $task->code(); |
|
52
|
|
|
|
|
|
|
$self->code(sub { |
|
53
|
2
|
|
|
2
|
|
7
|
$other_code->(@_); |
|
54
|
2
|
|
|
|
|
11
|
$orig_code->(@_); |
|
55
|
2
|
|
|
|
|
17
|
}); |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
|
59
|
|
|
|
|
|
|
|