File Coverage

lib/Haineko.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition 1 5 20.0
subroutine 5 5 100.0
pod 0 1 0.0
total 35 40 87.5


line stmt bran cond sub pod time code
1             package Haineko;
2 10     10   18735 use feature ':5.10';
  10         18  
  10         1431  
3 10     10   57 use strict;
  10         14  
  10         280  
4 10     10   50 use warnings;
  10         25  
  10         318  
5 10     10   6384 use parent 'Haineko::HTTPD';
  10         2417  
  10         75  
6              
7             our $VERSION = '0.2.16';
8             our $SYSNAME = 'Haineko';
9              
10             sub startup {
11 18     18 0 39 my $class = shift;
12 18         105 my $httpd = shift; # (Haineko::HTTPD);
13              
14 18         105 my $nekorouter = $httpd->router;
15 18         461 my $serverconf = $httpd->conf;
16 18   0     392 my $servername = $ENV{'HOSTNAME'} || $ENV{'SERVER_NAME'} || qx(hostname) || q();
17 18         55 chomp $servername;
18              
19 18         73 $serverconf->{'smtpd'}->{'system'} = $SYSNAME;
20 18         72 $serverconf->{'smtpd'}->{'version'} = $VERSION;
21 18   33     127 $serverconf->{'smtpd'}->{'hostname'} ||= $servername;
22 18         50 $serverconf->{'smtpd'}->{'servername'} = $servername;
23              
24 18         181 $nekorouter->connect( '/', { 'controller' => 'Root', 'action' => 'index' } );
25 18         1687 $nekorouter->connect( '/neko', { 'controller' => 'Root', 'action' => 'neko' } );
26 18         860 $nekorouter->connect( '/dump', { 'controller' => 'Root', 'action' => 'info' } );
27 18         1213 $nekorouter->connect( '/conf', { 'controller' => 'Root', 'action' => 'info' } );
28 18         1160 $nekorouter->connect( '/submit', { 'controller' => 'Sendmail', 'action' => 'submit' } );
29 18         836 $nekorouter->connect( '/sample/mail', { 'controller' => 'Sample', 'action' => 'mail' } );
30              
31 18         958 return $httpd->r;
32             }
33              
34             1;
35             __END__