line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::LinkResolver::Report; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
52
|
use strict; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
233
|
|
4
|
8
|
|
|
8
|
|
50
|
use warnings; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
220
|
|
5
|
8
|
|
|
8
|
|
44
|
use base qw( Text::Trac::LinkResolver ); |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
46
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.23'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
1607
|
|
|
1607
|
0
|
2414
|
my $self = shift; |
11
|
1607
|
|
|
|
|
3344
|
$self->{pattern} = '!?\{\d+\}'; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub format_link { |
15
|
5
|
|
|
5
|
0
|
19
|
my ( $self, $match, $target, $label ) = @_; |
16
|
5
|
50
|
|
|
|
36
|
return $match if $self->_is_disabled; |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
|
|
30
|
my $c = $self->{context}; |
19
|
5
|
|
66
|
|
|
28
|
$label ||= $match; |
20
|
5
|
|
|
|
|
25
|
my ($rev) = ( $match =~ m/(\d+)/ ); |
21
|
|
|
|
|
|
|
|
22
|
5
|
|
66
|
|
|
109
|
my $url = $c->{trac_report_url} || $c->trac_url . 'report/'; |
23
|
5
|
|
|
|
|
47
|
$url .= $rev; |
24
|
5
|
50
|
|
|
|
97
|
return sprintf '%s', ( $c->{class} ? q{class="report"} : '' ), $url, $label; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |