line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Repository::Mailrc; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
77
|
$CPAN::Repository::Mailrc::AUTHORITY = 'cpan:GETTY'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$CPAN::Repository::Mailrc::VERSION = '0.008'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: 01mailrc |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
11
|
use Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with qw( |
13
|
|
|
|
|
|
|
CPAN::Repository::Role::File |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
17
|
|
|
17
|
0
|
439
|
sub file_parts { 'authors', '01mailrc.txt' } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has aliases => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
lazy => 1, |
21
|
|
|
|
|
|
|
builder => '_build_aliases', |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _build_aliases { |
25
|
2
|
|
|
2
|
|
518
|
my ( $self ) = @_; |
26
|
2
|
100
|
|
|
|
9
|
return {} unless $self->exist; |
27
|
1
|
|
|
|
|
7
|
my @lines = $self->get_file_lines; |
28
|
1
|
|
|
|
|
498
|
my %aliases; |
29
|
1
|
|
|
|
|
3
|
for (@lines) { |
30
|
2
|
50
|
|
|
|
22
|
if ($_ =~ m/^alias (\w+) "(.*)"$/) { |
31
|
2
|
|
|
|
|
10
|
$aliases{$1} = $2; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
1
|
|
|
|
|
13
|
return \%aliases; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub set_alias { |
38
|
2
|
|
|
2
|
0
|
172
|
my ( $self, $author, $alias ) = @_; |
39
|
2
|
|
|
|
|
44
|
$self->aliases->{$author} = $alias; |
40
|
2
|
|
|
|
|
24
|
return $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub get_alias { |
44
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $author ) = @_; |
45
|
0
|
0
|
|
|
|
0
|
return defined $self->aliases->{$author} |
46
|
|
|
|
|
|
|
? $self->aliases->{$author} |
47
|
|
|
|
|
|
|
: (); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub generate_content { |
51
|
3
|
|
|
3
|
0
|
7
|
my ( $self ) = @_; |
52
|
3
|
|
|
|
|
11
|
my $content = ""; |
53
|
3
|
|
|
|
|
17
|
for (sort { $a cmp $b } keys %{$self->aliases}) { |
|
1
|
|
|
|
|
22
|
|
|
3
|
|
|
|
|
126
|
|
54
|
3
|
50
|
|
|
|
75
|
$content .= 'alias '.$_.' "'.( $self->aliases->{$_} ? $self->aliases->{$_} : $_ ).'"'."\n"; |
55
|
|
|
|
|
|
|
} |
56
|
3
|
|
|
|
|
33
|
return $content; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |