File Coverage

blib/lib/Object/Remote/Connector/INET.pm
Criterion Covered Total %
statement 9 13 69.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod n/a
total 12 19 63.1


line stmt bran cond sub pod time code
1             package Object::Remote::Connector::INET;
2              
3 11     11   5469 use IO::Socket::INET;
  11         16  
  11         86  
4 11     11   4191 use Moo;
  11         13  
  11         48  
5              
6             with 'Object::Remote::Role::Connector';
7              
8             has socket_path => (is => 'ro', required => 1);
9              
10             sub _open2_for {
11 0     0     my ($self) = @_;
12 0           my $path = $self->socket_path;
13 0 0         my $sock = IO::Socket::INET->new($path)
14             or die "Couldn't open socket ${path}: $!";
15 0           ($sock, $sock, undef);
16             }
17              
18 11     11   5646 no warnings 'once';
  11         12  
  11         1300  
19              
20             push @Object::Remote::Connection::Guess, sub {
21             for ($_[0]) {
22             if (defined and !ref and /^.+:\d+$/) {
23             my $socket = shift(@_);
24             return __PACKAGE__->new(@_, socket_path => $socket);
25             }
26             }
27             return;
28             };
29              
30             1;