| 1 | package Cogit::Protocol::SSH; | ||
| 2 | 4 | $Cogit::Protocol::SSH::VERSION = '0.001001'; | |
| 3 | 4 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use MooX::Types::MooseLike::Base 'Str'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | ▶ | use IPC::Open2; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 4 | extends 'Cogit::Protocol'; | |
| 9 | |||
| 10 | 4 | has hostname => ( | |
| 11 | is => 'ro', | ||
| 12 | isa => Str, | ||
| 13 | required => 1, | ||
| 14 | ); | ||
| 15 | |||
| 16 | 4 | has username => ( | |
| 17 | is => 'ro', | ||
| 18 | isa => Str, | ||
| 19 | ); | ||
| 20 | |||
| 21 | 4 | has path => ( | |
| 22 | is => 'ro', | ||
| 23 | isa => Str, | ||
| 24 | required => 1, | ||
| 25 | ); | ||
| 26 | |||
| 27 | 0 | ▶ | sub connect_socket { |
|
Subroutine
connect_socket: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 28 | 0 | my $self = shift; | |
| 29 | |||
| 30 | 0 | my ($read, $write); | |
| 31 | 0 | my $connect = join('@', grep { defined } $self->username, $self->hostname); | |
| 32 | 0 | my $pid = open2($read, $write, "ssh", $connect, "-o", "BatchMode yes", | |
| 33 | "git-upload-pack", $self->path,); | ||
| 34 | |||
| 35 | 0 | $read->autoflush(1); | |
| 36 | 0 | $write->autoflush(1); | |
| 37 | 0 | $self->read_socket($read); | |
| 38 | 0 | $self->write_socket($write); | |
| 39 | } | ||
| 40 | |||
| 41 | 4 | 1; | |
| 42 | |||
| 43 | __END__ | ||