BambooCli/Config.pm

filter: Statementstmt 92.5% 25 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 94.4% 34 / 36 CC 1 SCAR 0.3
CC
1
Cov
93%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« BambooCli/Command.pm ↑ Summary BambooCli.pm »
1 package App::BambooCli::Config;
2  
3 # Created on: 2019-06-03 12:55:20
4 # Create by: Ivan Wills
5 # $Id$
6 # $Revision$, $HeadURL$, $Date$
7 # $Revision$, $Source$, $Date$
8  
9 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use List::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 #use List::MoreUtils;
16 1 ▶use Data::Dumper qw/Dumper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use English qw/ -no_match_vars /;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 0 ▶use Net::Bamboo;
Subroutine BEGIN: called CC=1 SCAR=2.6
19  
20 our $VERSION = version->new('0.0.1');
21  
22 has name => (
23 is => 'rw',
24 default => sub {
25 return -f '.bamboo' ? '.bamboo' : "$ENV{HOME}/.bamboo";
26 },
27 );
28 has bamboo => (
29 is => 'rw',
30 lazy => 1,
31 builder => '_bamboo',
32 );
33 has [qw/ hostname username password debug /] => (
34 is => 'rw',
35 );
36  
37 sub _bamboo {
38 my ($self) = @_;
39 my $bamboo = new Net::Bamboo;
40  
41 $bamboo->hostname($self->hostname);
42 $bamboo->debug($self->debug);
43  
44 if ($self->username && $self->password) {
45 $bamboo->username($self->username);
46 $bamboo->password($self->password);
47 }
48  
49 return $bamboo;
50 }
51  
52 1;
53  
54 __END__
« BambooCli/Command.pm ↑ Summary BambooCli.pm »