File Coverage

blib/lib/Cogit/Protocol/SSH.pm
Criterion Covered Total %
statement 12 21 57.1
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 27 59.2


line stmt bran cond sub pod time code
1             package Cogit::Protocol::SSH;
2             $Cogit::Protocol::SSH::VERSION = '0.001001';
3 4     4   15 use Moo;
  4         7  
  4         24  
4 4     4   7276 use MooX::Types::MooseLike::Base 'Str';
  4         7  
  4         208  
5 4     4   1826 use IPC::Open2;
  4         10214  
  4         191  
6 4     4   23 use namespace::clean;
  4         5  
  4         34  
7              
8             extends 'Cogit::Protocol';
9              
10             has hostname => (
11             is => 'ro',
12             isa => Str,
13             required => 1,
14             );
15              
16             has username => (
17             is => 'ro',
18             isa => Str,
19             );
20              
21             has path => (
22             is => 'ro',
23             isa => Str,
24             required => 1,
25             );
26              
27             sub connect_socket {
28 0     0 0   my $self = shift;
29              
30 0           my ($read, $write);
31 0           my $connect = join('@', grep { defined } $self->username, $self->hostname);
  0            
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             1;
42              
43             __END__
44              
45             =pod
46              
47             =encoding UTF-8
48              
49             =head1 NAME
50              
51             Cogit::Protocol::SSH
52              
53             =head1 VERSION
54              
55             version 0.001001
56              
57             =head1 AUTHOR
58              
59             Arthur Axel "fREW" Schmidt <cogit@afoolishmanifesto.com>
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2017 by Arthur Axel "fREW" Schmidt.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut