File Coverage

blib/lib/System/InitD/GenInit/Debian.pm
Criterion Covered Total %
statement 26 27 96.3
branch 1 2 50.0
condition 1 3 33.3
subroutine 7 7 100.0
pod 0 1 0.0
total 35 40 87.5


line stmt bran cond sub pod time code
1             package System::InitD::GenInit::Debian;
2              
3 1     1   1259 use parent qw/System::InitD::Base/;
  1         2  
  1         10  
4              
5 1     1   75 use strict;
  1         2  
  1         32  
6 1     1   6 use warnings;
  1         1  
  1         41  
7              
8 1     1   6 use Carp;
  1         2  
  1         79  
9 1     1   935 use File::ShareDir qw/dist_file/;
  1         7232  
  1         83  
10              
11 1     1   8 use constant TEMPLATE => 'debian.tpl';
  1         2  
  1         134  
12              
13              
14             sub generate {
15 1 50 33 1 0 2452 if ( !ref $_[0] && $_[0] eq __PACKAGE__ ) {
16 1         2 shift;
17             }
18             else {
19 0         0 croak 'Bad params';
20             }
21 1         3 my ($options) = @_;
22              
23 1         11 my $generator = __PACKAGE__->new($options);
24              
25 1         5 my $data_location = dist_file('System-InitD', TEMPLATE);
26            
27             # пока-что так, MVP
28 1         611 $generator->forward_render_params($options, keys %$options);
29              
30 1         10 $generator->write_script($data_location);
31 1         20 return 1;
32             };
33              
34              
35             1;
36              
37             __END__