File Coverage

blib/lib/ShipIt/VC/SVK.pm
Criterion Covered Total %
statement 17 21 80.9
branch 3 4 75.0
condition 1 2 50.0
subroutine 4 6 66.6
pod 0 2 0.0
total 25 35 71.4


line stmt bran cond sub pod time code
1             package ShipIt::VC::SVK;
2 2     2   15070 use strict;
  2         5  
  2         62  
3 2     2   7 use base 'ShipIt::VC::SVN';
  2         4  
  2         435  
4 2     2   1280 use File::Temp ();
  2         21842  
  2         414  
5              
6 0     0 0 0 sub command { 'svk' }
7              
8             sub find_url {
9 0     0 0 0 my $self = shift;
10 0         0 my $info = `svk info`;
11 0         0 ($info =~ /^Depot Path: (.+)/m)[0];
12             }
13              
14             sub _tag_url_of_version {
15 2     2   26 my ($self, $ver) = @_;
16 2   50     17 my $url = $self->{tagpattern} || '';
17 2 100       9 unless ($url =~ m!^/!) {
18 1         12 $url = $self->_tag_base . $url;
19             }
20 2 50       12 $url .= "%v" unless $url =~ /\%v/i;
21 2         9 $url =~ s/\%v/$ver/ig;
22 2         8 $url =~ s!/+$!!;
23 2         11 return $url;
24             }
25              
26             =head1 NAME
27              
28             ShipIt::VC::SVK -- ShipIt's SVK support
29              
30             =head1 CONFIGURATION
31              
32             In your .shipit configuration file, the following options are recognized:
33              
34             =over
35              
36             =item B
37              
38             A pattern which ultimately expands into the absolute subversion URL for a tagged version. If the pattern isn't already absolute, the conventional "tags" directory is used as a base. The pattern has one magic variable, %v, which expands to the version number being tagged. If no %v is found, it's placed at the end.
39              
40             Example legit values:
41              
42             =over 8
43              
44             =item //example/tags/MyProject-%v
45              
46             =item MyProject-%v
47              
48             Both the above are equivalent.
49              
50             =item (nothing)
51              
52             Will automatically add %v to the end (of nothing), then auto-find your
53             'tags' URL, resulting in a final URL of:
54              
55             //example/tags/%v
56              
57             If your svk depot hosts more than one project, this default URL could
58             be bad, as the tagged directory has no project name in it.
59              
60             =back
61              
62             =back
63              
64             =cut
65              
66             1;
67              
68