line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
19
|
|
|
19
|
|
76
|
use strict; |
|
19
|
|
|
|
|
26
|
|
|
19
|
|
|
|
|
675
|
|
2
|
19
|
|
|
19
|
|
79
|
use warnings FATAL => 'recursion'; |
|
19
|
|
|
|
|
24
|
|
|
19
|
|
|
|
|
546
|
|
3
|
19
|
|
|
19
|
|
569
|
use utf8; |
|
19
|
|
|
|
|
41
|
|
|
19
|
|
|
|
|
117
|
|
4
|
|
|
|
|
|
|
|
5
|
19
|
|
|
19
|
|
6563
|
use Daiku::Task; |
|
19
|
|
|
|
|
53
|
|
|
19
|
|
|
|
|
815
|
|
6
|
19
|
|
|
19
|
|
8898
|
use Daiku::File; |
|
19
|
|
|
|
|
49
|
|
|
19
|
|
|
|
|
1354
|
|
7
|
19
|
|
|
19
|
|
8998
|
use Daiku::SuffixRule; |
|
19
|
|
|
|
|
53
|
|
|
19
|
|
|
|
|
709
|
|
8
|
|
|
|
|
|
|
|
9
|
19
|
|
|
19
|
|
11975
|
use Parse::CommandLine (); |
|
19
|
|
|
|
|
13580
|
|
|
19
|
|
|
|
|
507
|
|
10
|
19
|
|
|
19
|
|
11552
|
use Tie::IxHash; |
|
19
|
|
|
|
|
79292
|
|
|
19
|
|
|
|
|
798
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Daiku::Registry; |
13
|
19
|
|
|
19
|
|
177
|
use Mouse; |
|
19
|
|
|
|
|
31
|
|
|
19
|
|
|
|
|
176
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has tasks => ( |
16
|
|
|
|
|
|
|
is => 'rw', |
17
|
|
|
|
|
|
|
isa => 'HashRef', |
18
|
|
|
|
|
|
|
default => sub { tie my %h, "Tie::IxHash"; \%h }, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has temporary_desc => ( |
22
|
|
|
|
|
|
|
is => 'rw', |
23
|
|
|
|
|
|
|
isa => 'Str', |
24
|
|
|
|
|
|
|
clearer => 'clear_temporary_desc', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has namespaces => ( |
28
|
|
|
|
|
|
|
is => 'rw', |
29
|
|
|
|
|
|
|
isa => 'ArrayRef', |
30
|
|
|
|
|
|
|
default => sub { [] }, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub register { |
34
|
68
|
|
|
68
|
1
|
114
|
my ($self, $task) = (shift, shift); |
35
|
68
|
|
|
|
|
232
|
my $orig = $self->find_task($task->dst); |
36
|
68
|
100
|
|
|
|
151
|
$task->merge($orig) if $orig; |
37
|
68
|
|
|
|
|
434
|
$self->tasks->{$task->dst} = $task; |
38
|
68
|
|
|
|
|
1502
|
$task->registry($self); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub build { |
42
|
50
|
|
|
50
|
1
|
92
|
my ($self, $target) = @_; |
43
|
50
|
50
|
|
|
|
299
|
if (!defined $target) { |
44
|
0
|
|
|
|
|
0
|
die "Missing target\n"; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# parsing 'task_name[arg1 arg2]' |
48
|
50
|
|
|
|
|
407
|
($target, my $argument) = $target =~ /\A([^\[]+)(?:\[(.*)\])?\z/ms; |
49
|
50
|
|
|
|
|
116
|
my @args; |
50
|
50
|
100
|
|
|
|
130
|
@args = Parse::CommandLine::parse_command_line($argument) if defined $argument; |
51
|
|
|
|
|
|
|
|
52
|
50
|
|
|
|
|
331
|
my $task = $self->find_task($target); |
53
|
50
|
100
|
|
|
|
286
|
if ($task) { |
54
|
47
|
|
|
|
|
156
|
return $task->build($target, @args); |
55
|
|
|
|
|
|
|
} else { |
56
|
3
|
|
|
|
|
22
|
die "There is no rule to build '$target'\n"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub find_task { |
61
|
239
|
|
|
239
|
0
|
321
|
my ($self, $target) = @_; |
62
|
239
|
|
|
|
|
222
|
for my $task (values %{$self->{tasks}}) { |
|
239
|
|
|
|
|
1001
|
|
63
|
546
|
100
|
|
|
|
4705
|
return $task if $task->match($target); |
64
|
|
|
|
|
|
|
} |
65
|
138
|
100
|
|
|
|
2154
|
if ( -f $target ) { |
66
|
69
|
|
|
|
|
868
|
return Daiku::File->new( dst => $target ); |
67
|
|
|
|
|
|
|
} |
68
|
69
|
|
|
|
|
121
|
return undef; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
19
|
|
|
19
|
|
14043
|
no Mouse; __PACKAGE__->meta->make_immutable; |
|
19
|
|
|
|
|
39
|
|
|
19
|
|
|
|
|
106
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |