Show
Ignore:
Timestamp:
10/24/08 18:08:00 (5 years ago)
Author:
yappo
Message:

add Module::Setup::Flavor::SelectVC

Location:
lang/perl/Module-Setup/trunk/lib/Module/Setup/Flavor
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Module-Setup/trunk/lib/Module/Setup/Flavor/Default.pm

    r22032 r22044  
    22use strict; 
    33use warnings; 
    4 use base 'Module::Setup::Flavor'; 
    5  
    6  
    7 sub setup_config { 
    8     my($self, $context, $config) = @_; 
    9  
    10     my %vcs = ( 
    11         SVN => 'VC::SVN', 
    12         SVK => 'VC::SVK', 
    13         Git => 'VC::Git', 
    14     ); 
    15  
    16     for my $name (qw/ SVN SVK Git /) { 
    17         my $pkg = $vcs{$name}; 
    18         next unless $context->dialog("Do you use $name? [yN]", 'n') =~ /[Yy]/; 
    19         $context->log("You chose version control system: $name"); 
    20  
    21         next if grep { 
    22             ( ref($_) eq 'HASH' && $_->{module} eq $pkg) || $_ eq $pkg 
    23         } @{ $config->{plugins} }; 
    24  
    25         push @{ $config->{plugins} }, $pkg; 
    26     } 
    27  
    28     if(grep { 
    29         ( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVK') || $_ eq 'VC::SVK' 
    30     } @{ $config->{plugins} }) { 
    31         my @plugins = grep { 
    32             !(( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVN') || $_ eq 'VC::SVN') 
    33         } @{ $config->{plugins} }; 
    34         $config->{plugins} = \@plugins; 
    35     } 
    36  
    37 } 
     4use base 'Module::Setup::Flavor::SelectVC'; 
    385 
    3961; 
  • lang/perl/Module-Setup/trunk/lib/Module/Setup/Flavor/PBP.pm

    r22032 r22044  
    22use strict; 
    33use warnings; 
    4 use base 'Module::Setup::Flavor'; 
    5  
    6 sub setup_config { 
    7     my($class, $context, $config) = @_; 
    8  
    9     my %vcs = ( 
    10         SVN => 'VC::SVN', 
    11         SVK => 'VC::SVK', 
    12         Git => 'VC::Git', 
    13     ); 
    14  
    15     for my $name (qw/ SVN SVK Git /) { 
    16         my $pkg = $vcs{$name}; 
    17         next unless $context->dialog("Do you use $name? [yN]", 'n') =~ /[Yy]/; 
    18         $context->log("You chose version control system: $name"); 
    19  
    20         next if grep { 
    21             ( ref($_) eq 'HASH' && $_->{module} eq $pkg) || $_ eq $pkg 
    22         } @{ $config->{plugins} }; 
    23  
    24         push @{ $config->{plugins} }, $pkg; 
    25     } 
    26  
    27     if(grep { 
    28         ( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVK') || $_ eq 'VC::SVK' 
    29     } @{ $config->{plugins} }) { 
    30         my @plugins = grep { 
    31             !(( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVN') || $_ eq 'VC::SVN') 
    32         } @{ $config->{plugins} }; 
    33         $config->{plugins} = \@plugins; 
    34     } 
    35  
    36 } 
     4use base 'Module::Setup::Flavor::SelectVC'; 
    375 
    3861;