blib/lib/MooseX/Role/Net/OpenSSH.pm

filter: Statementstmt 86.9% 20 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 85.7% 24 / 28 CC 1 SCAR 1.8
CC
1
Cov
87%
_build_ssh
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package MooseX::Role::Net::OpenSSH;
2 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Net::OpenSSH;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # ABSTRACT: A Moose role that provides a Net::OpenSSH Object
8 3 our $VERSION = '0.001'; # VERSION
9  
10 3 has 'ssh' => (
11 isa => 'Net::OpenSSH',
12 is => 'ro',
13 lazy_build => 1,
14 );
15  
16 3 for my $name ( qw/ ssh_hostname ssh_username / ) {
17 6 my $builder = '_build_' . $name;
18 6 my $writer = '_set_' . $name;
19 6 has $name => (
20 is => 'ro',
21 isa => 'Str',
22 builder => $builder,
23 writer => $writer,
24 lazy_build => 1,
25 );
26 }
27  
28 3 has 'ssh_options' => (
29 isa => 'HashRef',
30 is => 'ro',
31 lazy_build => 1,
32 );
33  
34 0 ▶sub _build_ssh {
Subroutine _build_ssh: not called CC=1 SCAR=6.9
35 0 my $self = shift;
36 0 Net::OpenSSH->new( $self->ssh_hostname, %{ $self->ssh_options } );
37 }
38  
39 3 1;
40  
41 __END__
↑ Summary