| 1 | package Text::Trac::LinkResolver::Changeset; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 48 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 48 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 48 | ▶ | use base qw( Text::Trac::LinkResolver ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 48 | our $VERSION = '0.23'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | sub init { | ||||||||||||||||||||
| 10 | 5462 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 11 | 5462 | $self->{pattern} = '!?\[\d+\]|(?:\b|!)r\d+\b(?!:\d)'; | |||||||||||||||||||
| 12 | } | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | sub format_link { | ||||||||||||||||||||
| 15 | 10 | ▶ | my ( $self, $match, $target, $label ) = @_; | ||||||||||||||||||
|
Subroutine
format_link: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||
| 16 | 10 | ▶ | return $match if $self->_is_disabled; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 10 | my $c = $self->{context}; | |||||||||||||||||||
| 19 | 10 | ▶ | $label ||= $match; | ||||||||||||||||||
|
Condition66%2/3
$label ||= $match
MC/DC0%0/2
$label ||= $match
$label
$match
Truth table66%2/3
A ||= B
A= $labelB= $match
| |||||||||||||||||||||
| 20 | 10 | my ($rev) = ( $match =~ m/(\d+)/ ); | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 10 | ▶ | my $url = $c->{trac_changeset_url} || $c->trac_url . 'changeset/'; | ||||||||||||||||||
|
Condition100%2/2
$c->{'trac_changeset_url'} || $c->trac_url . 'changeset/'
MC/DC100%1/1
$c->{'trac_changeset_url'} || $c->trac_url . 'changeset/'
$c->{'trac_changeset_url'}
Truth table100%2/2
A
A= $c->{'trac_changeset_url'}
| |||||||||||||||||||||
| 23 | 10 | $url .= $rev; | |||||||||||||||||||
| 24 | 10 | ▶ | return sprintf '<a %s href="%s">%s</a>', ( $c->{class} ? q{class="changeset"} : '' ), $url, $label; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 48 | 1; | |||||||||||||||||||