line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::PRT::Util::DestinationFile; |
2
|
5
|
|
|
5
|
|
2295
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
153
|
|
3
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
146
|
|
4
|
5
|
|
|
5
|
|
30
|
use Path::Class; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
1490
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub destination_file { |
8
|
23
|
|
|
23
|
0
|
8815
|
my ($source_class_name, $destination_class_name, $input_file) = @_; |
9
|
|
|
|
|
|
|
|
10
|
23
|
|
|
|
|
64
|
my @delimiters = do { |
11
|
23
|
|
|
|
|
33
|
my $pattern = $source_class_name; |
12
|
23
|
|
|
|
|
104
|
$pattern =~ s{::}{(.+)}g; |
13
|
23
|
|
|
|
|
765
|
($input_file =~ qr/^(.*)$pattern(.*)$/); |
14
|
|
|
|
|
|
|
}; |
15
|
23
|
|
|
|
|
68
|
my $prefix = shift @delimiters; |
16
|
23
|
|
|
|
|
44
|
my $suffix = pop @delimiters; |
17
|
|
|
|
|
|
|
|
18
|
23
|
|
|
|
|
38
|
my $fallback_delimiter = $delimiters[-1]; |
19
|
23
|
|
|
|
|
113
|
my $dir = file($input_file)->dir; |
20
|
23
|
|
|
|
|
3148
|
$dir = $dir->parent for grep { $_ eq '/' } @delimiters; |
|
23
|
|
|
|
|
93
|
|
21
|
23
|
|
|
|
|
1367
|
my $basename = $destination_class_name; |
22
|
23
|
|
|
|
|
78
|
$basename =~ s{::}{ |
23
|
25
|
|
66
|
|
|
98
|
shift @delimiters // $fallback_delimiter; |
24
|
|
|
|
|
|
|
}ge; |
25
|
23
|
|
|
|
|
97
|
$dir->file("$basename$suffix")->stringify; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |