line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Flavor::SelectVC; |
2
|
18
|
|
|
18
|
|
87
|
use strict; |
|
18
|
|
|
|
|
24
|
|
|
18
|
|
|
|
|
456
|
|
3
|
18
|
|
|
18
|
|
62
|
use warnings; |
|
18
|
|
|
|
|
23
|
|
|
18
|
|
|
|
|
417
|
|
4
|
18
|
|
|
18
|
|
64
|
use base 'Module::Setup::Flavor'; |
|
18
|
|
|
|
|
24
|
|
|
18
|
|
|
|
|
5472
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub setup_config { |
7
|
38
|
|
|
38
|
0
|
127
|
my($self, $context, $config) = @_; |
8
|
|
|
|
|
|
|
|
9
|
38
|
|
|
|
|
226
|
my %vcs = ( |
10
|
|
|
|
|
|
|
SVN => 'VC::SVN', |
11
|
|
|
|
|
|
|
SVK => 'VC::SVK', |
12
|
|
|
|
|
|
|
Git => 'VC::Git', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
38
|
|
|
|
|
90
|
for my $name (qw/ SVN SVK Git /) { |
16
|
114
|
|
|
|
|
191
|
my $pkg = $vcs{$name}; |
17
|
114
|
100
|
|
|
|
474
|
next unless $context->dialog("Do you use $name? [yN]", 'n') =~ /[Yy]/; |
18
|
11
|
|
|
|
|
57
|
$context->log("You chose version control system: $name"); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
next if grep { |
21
|
18
|
100
|
100
|
|
|
77
|
( ref($_) eq 'HASH' && $_->{module} eq $pkg) || $_ eq $pkg |
22
|
11
|
100
|
|
|
|
7
|
} @{ $config->{plugins} }; |
|
11
|
|
|
|
|
16
|
|
23
|
|
|
|
|
|
|
|
24
|
7
|
|
|
|
|
7
|
push @{ $config->{plugins} }, $pkg; |
|
7
|
|
|
|
|
11
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
38
|
100
|
|
|
|
72
|
if(grep { |
28
|
137
|
100
|
100
|
|
|
778
|
( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVK') || $_ eq 'VC::SVK' |
29
|
38
|
|
|
|
|
108
|
} @{ $config->{plugins} }) { |
30
|
|
|
|
|
|
|
my @plugins = grep { |
31
|
17
|
|
100
|
|
|
63
|
!(( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVN') || $_ eq 'VC::SVN') |
32
|
6
|
|
|
|
|
7
|
} @{ $config->{plugins} }; |
|
6
|
|
|
|
|
8
|
|
33
|
6
|
|
|
|
|
18
|
$config->{plugins} = \@plugins; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Module::Setup::Flavor::SelectVC - select version control system logic |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package YourFlavor; |
47
|
|
|
|
|
|
|
use base 'Module::Setup::Flavor::SelectVC'; |
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__DATA__ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
--- |
53
|
|
|
|
|
|
|
file: foo |
54
|
|
|
|
|
|
|
template: bar |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
... |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|