X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FSSH.pm;h=fb6ed4b693031b4514e2138e20fce9ce2de81b03;hp=bf24a0a4414ce3eacfa14d755f15d18fbb6c1737;hb=fbd3b8ecbd2c9004f0e56ff1c0bc30f677a19c62;hpb=12fb4a80d68ad14c18a35f60cc6d8a671f728ac9 diff --git a/lib/Object/Remote/Connector/SSH.pm b/lib/Object/Remote/Connector/SSH.pm index bf24a0a..fb6ed4b 100644 --- a/lib/Object/Remote/Connector/SSH.pm +++ b/lib/Object/Remote/Connector/SSH.pm @@ -6,9 +6,11 @@ use Moo; with 'Object::Remote::Role::Connector::PerlInterpreter'; +has ssh_to => (is => 'ro', required => 1); + around _perl_command => sub { - my ($orig, $self, $target) = @_; - return 'ssh', '-A', $target, $self->$orig($target); + my ($orig, $self) = @_; + return 'ssh', '-A', $self->ssh_to, $self->$orig; }; no warnings 'once'; @@ -17,7 +19,7 @@ push @Object::Remote::Connection::Guess, sub { for ($_[0]) { # 0-9 a-z _ - first char, those or . subsequent - hostnamish if (defined and !ref and /^(?:.*?\@)?[\w\-][\w\-\.]/) { - return __PACKAGE__->new->connect($_[0]); + return __PACKAGE__->new(ssh_to => $_[0]); } } return;