line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Locale::File::PO::Header::Base; ## no critic (TidyCode) |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
2047
|
use Moose; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
28
|
|
4
|
5
|
|
|
5
|
|
29329
|
use namespace::autoclean; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.004'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub default { ## no critic (BuiltinHomonyms) |
9
|
0
|
|
|
0
|
0
|
0
|
return; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub trigger_helper { |
13
|
86
|
|
|
86
|
0
|
152
|
my ($self, $arg_ref) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ($new, $current, $default) = map { |
16
|
258
|
100
|
|
|
|
543
|
defined $_ ? $_ : q{}; |
17
|
86
|
|
|
|
|
124
|
} @{$arg_ref}{ qw(new current default) }; |
|
86
|
|
|
|
|
174
|
|
18
|
86
|
100
|
|
|
|
169
|
if ( ! length $new ) { |
19
|
35
|
|
|
|
|
47
|
$new = $default; |
20
|
|
|
|
|
|
|
} |
21
|
86
|
100
|
100
|
|
|
345
|
if ( |
|
|
|
100
|
|
|
|
|
22
|
|
|
|
|
|
|
( defined $arg_ref->{new} xor defined $arg_ref->{current} ) |
23
|
|
|
|
|
|
|
|| $new ne $current |
24
|
|
|
|
|
|
|
) { |
25
|
44
|
|
|
|
|
69
|
my $writer = $arg_ref->{writer}; |
26
|
44
|
|
|
|
|
1306
|
$self->$writer($new); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
86
|
|
|
|
|
2336
|
return; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub header_keys { |
33
|
21
|
|
|
21
|
0
|
30
|
my $self = shift; |
34
|
|
|
|
|
|
|
|
35
|
21
|
|
|
|
|
511
|
return $self->name; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub format_line { |
39
|
24
|
|
|
24
|
0
|
69
|
my ($self, $line, %args) = @_; |
40
|
|
|
|
|
|
|
|
41
|
24
|
|
|
|
|
57
|
for my $key ( keys %args ) { |
42
|
56
|
|
|
|
|
551
|
$line =~ s{ |
43
|
|
|
|
|
|
|
[{] |
44
|
|
|
|
|
|
|
\Q$key\E |
45
|
|
|
|
|
|
|
[}] |
46
|
|
|
|
|
|
|
} { |
47
|
|
|
|
|
|
|
defined $args{$key} |
48
|
56
|
50
|
|
|
|
209
|
? $args{$key} |
49
|
|
|
|
|
|
|
: q{} |
50
|
|
|
|
|
|
|
}xmsge; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
24
|
|
|
|
|
90
|
return $line; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# $Id: Utils.pm 602 2011-11-13 13:49:23Z steffenw $ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |