3d8956415e6a3367ddf24343054ce5002c1c28de
[scpubgit/Object-Remote.git] / lib / Object / Remote / Connector / SSH.pm
1 package Object::Remote::Connector::SSH;
2
3 use Object::Remote::ModuleSender;
4 use Object::Remote::Handle;
5 use Moo;
6
7 with 'Object::Remote::Role::Connector::PerlInterpreter';
8
9 around _perl_command => sub {
10   my ($orig, $self, $target) = @_;
11   return 'ssh', $target, $self->$orig($target);
12 };
13
14 push @Object::Remote::Connection::Guess, sub { 
15   for ($_[0]) {
16     # 0-9 a-z _ - first char, those or . subsequent - hostnamish
17     if (defined and !ref and /^(?:.*?\@)?[\w\-][\w\-\.]/) {
18       return __PACKAGE__->new->connect($_[0]);
19     }
20   }
21   return;
22 };
23
24 1;