File Coverage

blib/lib/Module/Setup/Plugin/Config/Basic.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition 4 4 100.0
subroutine 5 5 100.0
pod 1 2 50.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package Module::Setup::Plugin::Config::Basic;
2 18     18   82 use strict;
  18         25  
  18         543  
3 18     18   74 use warnings;
  18         26  
  18         583  
4 18     18   72 use base 'Module::Setup::Plugin';
  18         21  
  18         5188  
5              
6             sub register {
7 72     72 0 153 my($self, ) = @_;
8 72         348 $self->add_trigger( before_dump_config => \&before_dump_config );
9             }
10              
11             sub before_dump_config {
12 33     33 1 2109 my($self, $config) = @_;
13              
14 33   100     269 $config->{author} ||= 'Default Name';
15 33         186 $config->{author} = $self->dialog("Your name: ", $config->{author});
16              
17 33   100     223 $config->{email} ||= 'default {at} example.com';
18 33         109 $config->{email} = $self->dialog("Your email: ", $config->{email});
19             }
20              
21             1;