line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Setup::Flavor::SelectVC; |
2
|
21
|
|
|
21
|
|
146
|
use strict; |
|
21
|
|
|
|
|
47
|
|
|
21
|
|
|
|
|
702
|
|
3
|
21
|
|
|
21
|
|
173
|
use warnings; |
|
21
|
|
|
|
|
40
|
|
|
21
|
|
|
|
|
522
|
|
4
|
21
|
|
|
21
|
|
107
|
use base 'Module::Setup::Flavor'; |
|
21
|
|
|
|
|
43
|
|
|
21
|
|
|
|
|
10159
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub setup_config { |
7
|
39
|
|
|
39
|
1
|
172
|
my($self, $context, $config) = @_; |
8
|
|
|
|
|
|
|
|
9
|
39
|
|
|
|
|
1929
|
my %vcs = ( |
10
|
|
|
|
|
|
|
SVN => 'VC::SVN', |
11
|
|
|
|
|
|
|
SVK => 'VC::SVK', |
12
|
|
|
|
|
|
|
Git => 'VC::Git', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
39
|
|
|
|
|
108
|
for my $name (qw/ SVN SVK Git /) { |
16
|
117
|
|
|
|
|
290
|
my $pkg = $vcs{$name}; |
17
|
117
|
100
|
|
|
|
829
|
next unless $context->dialog("Do you use $name? [yN]", 'n') =~ /[Yy]/; |
18
|
11
|
|
|
|
|
94
|
$context->log("You chose version control system: $name"); |
19
|
|
|
|
|
|
|
|
20
|
18
|
100
|
100
|
|
|
126
|
next if grep { |
21
|
11
|
|
|
|
|
28
|
( ref($_) eq 'HASH' && $_->{module} eq $pkg) || $_ eq $pkg |
22
|
11
|
100
|
|
|
|
15
|
} @{ $config->{plugins} }; |
23
|
|
|
|
|
|
|
|
24
|
7
|
|
|
|
|
10
|
push @{ $config->{plugins} }, $pkg; |
|
7
|
|
|
|
|
22
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
39
|
100
|
100
|
|
|
124
|
if(grep { |
|
141
|
100
|
|
|
|
1178
|
|
28
|
39
|
|
|
|
|
136
|
( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVK') || $_ eq 'VC::SVK' |
29
|
|
|
|
|
|
|
} @{ $config->{plugins} }) { |
30
|
17
|
|
100
|
|
|
104
|
my @plugins = grep { |
31
|
6
|
|
|
|
|
17
|
!(( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVN') || $_ eq 'VC::SVN') |
32
|
6
|
|
|
|
|
10
|
} @{ $config->{plugins} }; |
33
|
6
|
|
|
|
|
30
|
$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
|
|
|
|
|
|
|
|