| 1 | package Net::Rendezvous::Publish; | ||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use Net::Rendezvous::Publish::Service; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | use Module::Pluggable | ||||||||||||||||||||
| 7 | 1 | ▶ | search_path => [ "Net::Rendezvous::Publish::Backend" ], | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | sub_name => 'backends'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | ▶ | use base qw( Class::Accessor::Lvalue ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 1 | __PACKAGE__->mk_accessors(qw( _backend _published )); | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 1 | our $VERSION = 0.04; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||
| 16 | 0 | my $class = shift; | |||||||||||||||||||
| 17 | 0 | my %args = @_; | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 0 | my $self = $class->SUPER::new; | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 0 | ▶ | my ($backend) = $args{backend} || (grep !/::Null$/, $self->backends)[0]; | ||||||||||||||||||
|
Condition0%0/3
$args{'backend'} || (grep((!/::Null$/), $self->backends))[0]
MC/DC0%0/2
$args{'backend'} || (grep((!/::Null$/), $self->backends))[0]
$args{'backend'}
(grep((!/::Null$/), $self->backends))[0]
Truth table0%0/3
A || B
A= $args{'backend'}B= (grep((!/::Null$/), $self->backends))[0]
| |||||||||||||||||||||
| 22 | 0 | ▶ | $backend ||= "Net::Rendezvous::Publish::Backend::Null"; | ||||||||||||||||||
|
Condition0%0/2
$backend ||= "Net::Rendezvous::Publish::Backend::Null"
MC/DC0%0/1
$backend ||= "Net::Rendezvous::Publish::Backend::Null"
$backend
Truth table0%0/2
A
A= $backend
| |||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | ▶ | eval "require $backend" or die $@; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | 0 | ▶ | return unless $backend; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 0 | ▶ | $self->_backend = $backend->new | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 27 | or return; | ||||||||||||||||||||
| 28 | 0 | $self->_published = []; | |||||||||||||||||||
| 29 | 0 | return $self; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | ▶ | sub publish { | ||||||||||||||||||
|
Subroutine
publish: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 33 | 0 | my $self = shift; | |||||||||||||||||||
| 34 | 0 | my $service = Net::Rendezvous::Publish::Service->new; | |||||||||||||||||||
| 35 | 0 | $service->_session = $self; | |||||||||||||||||||
| 36 | 0 | ▶ | $service->_handle = $self->_backend->publish( object => $service, @_ ) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 37 | or return; | ||||||||||||||||||||
| 38 | 0 | return $service; | |||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 0 | ▶ | sub step { | ||||||||||||||||||
|
Subroutine
step: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 42 | 0 | my $self = shift; | |||||||||||||||||||
| 43 | 0 | $self->_backend->step( shift ); | |||||||||||||||||||
| 44 | 0 | return $self; | |||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 1 | 1; | |||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | __END__ | ||||||||||||||||||||