X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FLocal.pm;h=6119e3ff3f612decc69f190ed526b674617e7f4f;hp=33f599f85c5d3ac74693e9456a368593028976fc;hb=bef36e73e4257b2ba8e59eb55661ffc51d8a620a;hpb=9e72f0cf54e92bccdba71eb75037f1cfe4f69f36 diff --git a/lib/Object/Remote/Connector/Local.pm b/lib/Object/Remote/Connector/Local.pm index 33f599f..6119e3f 100644 --- a/lib/Object/Remote/Connector/Local.pm +++ b/lib/Object/Remote/Connector/Local.pm @@ -1,18 +1,18 @@ package Object::Remote::Connector::Local; -use IPC::Open2; -use Object::Remote::Connection; use Moo; -sub connect { - # XXX bin/ is wrong but meh, fix later - my $pid = open2(my $its_stdin, my $its_stdout, 'bin/object-remote-node') - or die "Couldn't start local node: $!"; - Object::Remote::Connection->new( - send_to_fh => $its_stdin, - receive_from_fh => $its_stdout, - child_pid => $pid - ); -} +with 'Object::Remote::Role::Connector::PerlInterpreter'; + +no warnings 'once'; + +BEGIN { } + +push @Object::Remote::Connection::Guess, sub { + if (($_[0]||'') eq '-') { + shift(@_); + __PACKAGE__->new(@_); + } +}; 1;