Zing/Server.pm

filter: Statementstmt 88.5% 31 / 35 Branchbran 0.0% 0 / 4 Conditioncond 25.0% 1 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 90.0% 9 / 10 Podpod 0.0% 0 / 1 totaltotal 73.2% 41 / 56 CC 4 SCAR 19.2
CC
4
Cov
74%
new_name
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.8
« Zing/Poll.pm ↑ Summary Zing/Mailbox.pm »
1 package Zing::Server;
2  
3 49 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 49 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 49 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 49 ▶use registry 'Zing::Types';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 49 ▶use routines;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 49 ▶use Data::Object::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 49 ▶use Data::Object::ClassHas;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 49 ▶use Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 49 ▶use Sys::Hostname;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 49 our $VERSION = '0.11'; # VERSION
18  
19 # ATTRIBUTES
20  
21 49 has 'name' => (
22 is => 'ro',
23 isa => 'Str',
24 new => 1,
25 );
26  
27 49 ▶state $local = $ENV{ZING_HOST} || '0.0.0.0';
Condition50%1/2
$ENV{'ZING_HOST'} || '0.0.0.0'
l!l
490
MC/DC0%0/1
$ENV{'ZING_HOST'} || '0.0.0.0'
$ENV{'ZING_HOST'}
Truth table50%1/2
A
A= $ENV{'ZING_HOST'}
Aresult
11
00
28  
29 0 ▶fun new_name($self) {
Subroutine new_name: not called CC=4 SCAR=30.0
Pod undocumented
30 0 ▶ state $host = gethostbyname(hostname || 'localhost') if !$ENV{ZING_HOST};
Branch: 1 branch
BranchTrueFalseTotal
unless $ENV{"ZING_HOST"} 0 0 0
Condition0%0/2
hostname() || 'localhost'
l!l
00
MC/DC0%0/1
hostname() || 'localhost'
hostname()
Truth table0%0/2
A
A= hostname()
Aresult
11
00
31 0 ▶ $host ? inet_ntoa($host) : $local
Branch: 1 branch
BranchTrueFalseTotal
$host ? : 0 0 0
32 49 }
33  
34 49 1;
35  
36 =encoding utf8
37  
38 =head1 NAME
39  
40 Zing::Server - Server Information
41  
42 =cut
43  
44 =head1 ABSTRACT
45  
46 Process Server Information
47  
48 =cut
49  
50 =head1 SYNOPSIS
51  
52 use Zing::Server;
53  
54 my $server = Zing::Server->new;
55  
56 =cut
57  
58 =head1 DESCRIPTION
59  
60 This package provides represents a server within a network and cluster.
61  
62 =cut
63  
64 =head1 LIBRARIES
65  
66 This package uses type constraints from:
67  
68 L<Zing::Types>
69  
70 =cut
71  
72 =head1 ATTRIBUTES
73  
74 This package has the following attributes:
75  
76 =cut
77  
78 =head2 name
79  
80 name(Str)
81  
82 This attribute is read-only, accepts C<(Str)> values, and is optional.
83  
84 =cut
85  
86 =head1 AUTHOR
87  
88 Al Newkirk, C<awncorp@cpan.org>
89  
90 =head1 LICENSE
91  
92 Copyright (C) 2011-2019, Al Newkirk, et al.
93  
94 This is free software; you can redistribute it and/or modify it under the terms
95 of the The Apache License, Version 2.0, as elucidated in the L<"license
96 file"|https://github.com/iamalnewkirk/zing/blob/master/LICENSE>.
97  
98 =head1 PROJECT
99  
100 L<Wiki|https://github.com/iamalnewkirk/zing/wiki>
101  
102 L<Project|https://github.com/iamalnewkirk/zing>
103  
104 L<Initiatives|https://github.com/iamalnewkirk/zing/projects>
105  
106 L<Milestones|https://github.com/iamalnewkirk/zing/milestones>
107  
108 L<Contributing|https://github.com/iamalnewkirk/zing/blob/master/CONTRIBUTE.md>
109  
110 L<Issues|https://github.com/iamalnewkirk/zing/issues>
111  
112 =cut
« Zing/Poll.pm ↑ Summary Zing/Mailbox.pm »