line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Trac::LinkResolver::Ticket; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
46
|
use strict; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
190
|
|
4
|
8
|
|
|
8
|
|
31
|
use warnings; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
174
|
|
5
|
8
|
|
|
8
|
|
30
|
use base qw( Text::Trac::LinkResolver ); |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
33
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.24'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
1607
|
|
|
1607
|
0
|
1959
|
my $self = shift; |
11
|
1607
|
|
|
|
|
2865
|
$self->{pattern} = '!?(?
|
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub format_link { |
15
|
7
|
|
|
7
|
0
|
23
|
my ( $self, $match, $target, $label ) = @_; |
16
|
7
|
100
|
|
|
|
44
|
return $match if $self->_is_disabled; |
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
|
|
28
|
my $c = $self->{context}; |
19
|
6
|
|
66
|
|
|
21
|
$label ||= $match; |
20
|
6
|
|
|
|
|
24
|
my ($rev) = ( $match =~ m/(\d+)/ ); |
21
|
|
|
|
|
|
|
|
22
|
6
|
|
66
|
|
|
120
|
my $url = $c->{trac_ticket_url} || $c->trac_url . 'ticket/'; |
23
|
6
|
|
|
|
|
41
|
$url .= $rev; |
24
|
6
|
50
|
|
|
|
77
|
return sprintf '%s', ( $c->{class} ? q{class="ticket"} : '' ), $url, $label; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |