X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FUNIX.pm;h=99e9a44565f93c085ab264c07bf0f44bce813906;hb=f425c3cb155190f7113bda4ad91d831662a2ac7a;hp=614609aaecdb32c04fd4fbbc518893348ba7e87f;hpb=0e547800d52ca183014b58016504fa2f9600a456;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Connector/UNIX.pm b/lib/Object/Remote/Connector/UNIX.pm index 614609a..99e9a44 100644 --- a/lib/Object/Remote/Connector/UNIX.pm +++ b/lib/Object/Remote/Connector/UNIX.pm @@ -5,8 +5,11 @@ use Moo; with 'Object::Remote::Role::Connector'; +has socket_path => (is => 'ro', required => 1); + sub _open2_for { - my ($self,$path) = @_; + my ($self) = @_; + my $path = $self->socket_path; my $sock = IO::Socket::UNIX->new($path) or die "Couldn't open socket ${path}: $!"; ($sock, $sock, undef); @@ -14,10 +17,11 @@ sub _open2_for { no warnings 'once'; -push @Object::Remote::Connection::Guess, sub { +push @Object::Remote::Connection::Guess, sub { for ($_[0]) { if (defined and !ref and /^(?:\.\/|\/)/) { - return __PACKAGE__->new->connect($_[0]); + my $socket = shift(@_); + return __PACKAGE__->new(@_, socket_path => $socket); } } return;