blib/lib/Poet/Server.pm

filter: Statementstmt 72.0% 31 / 43 Branchbran 25.0% 2 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod n/a totaltotal 68.8% 42 / 61 CC 6 SCAR 17.7
CC
6
Cov
65%
__ANON__
17.6
__ANON__
3.0
BEGIN
1.3
CRAP 5.8
« blib/lib/Poet/Log.pm ↑ Summary blib/lib/Poet/Util/Web.pm »
1 package Poet::Server;
2 2 $Poet::Server::VERSION = '0.16';
3 2 ▶use Poet qw($conf $poet);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Method::Signatures::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Class::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Class::MOP;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶method get_plackup_options () {
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine __ANON__: not called CC=4 SCAR=28.7
11  
12 0 my @options;
13  
14 # Pass -E with the layer name, e.g. "development" or "production"
15 #
16 0 push( @options, '-E', $conf->layer );
17  
18 0 ▶ if ( defined( my $port = $conf->get('server.port') ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $port = $Poet::Server::conf->get("server.port"))) 0 0 0
19 0 push( @options, '--port', $port );
20 }
21 0 ▶ if ( defined( my $host = $conf->get('server.host') ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $host = $Poet::Server::conf->get("server.host"))) 0 0 0
22 0 push( @options, '--host', $host );
23 }
24  
25 0 ▶ if ( $conf->is_development ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Poet::Server::conf->is_development) { } 0 0 0
26  
27 # In development mode, reload server when conf or lib file changes
28 #
29 0 push( @options, '-R', join( ",", $poet->conf_dir, $poet->lib_dir ) );
30 }
31 else {
32  
33 # In live mode, use access log instead of STDERR
34 #
35 0 push( @options, '--access-log', $poet->logs_path("access.log") );
36 }
37  
38 0 return @options;
39 2 }
40  
41 2 my $loaded_startup_modules;
42  
43 2 ▶method load_startup_modules () {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=3 SCAR=11.0
44 14 ▶ return if $loaded_startup_modules++;
Branch: 1 branch
BranchTrueFalseTotal
if $loaded_startup_modules++ 12 2 14
45 2 foreach my $module ( @{ $conf->get_list('server.load_modules') } ) {
46 2 Class::Load::load_class($module);
47 }
48 2 }
49  
50 2 1;
« blib/lib/Poet/Log.pm ↑ Summary blib/lib/Poet/Util/Web.pm »