Enbld/Command/Install.pm untested

filter: Statementstmt 0.0% 0 / 55 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 73 CC 3 SCAR 13.9
CC
3
Cov
0%
do
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package Enbld::Command::Install;
2  
3 use strict;
4 use warnings;
5  
6 use 5.010001;
7  
8 use parent qw/Enbld::Command/;
9  
10 use Try::Lite;
11  
12 require Enbld::App::Configuration;
13 require Enbld::Error;
14 require Enbld::Exception;
15 require Enbld::Message;
16 require Enbld::Target;
17 require Enbld::Logger;
18 require Enbld::Condition;
19  
20 sub do {
21 my $self = shift;
22  
23 my $target_name = $self->validate_target_name( shift @{ $self->{argv} } );
24 my $version = shift @{ $self->{argv} };
25  
26 $self->setup;
27  
28 my $config = Enbld::App::Configuration->search_config( $target_name );
29 my $target = Enbld::Target->new( $target_name, $config );
30  
31 my $installed = try {
32 return $target->install( $version );
33 } ( 'Enbld::Error' => sub {
34 Enbld::Message->alert( $@ );
35  
36 if ( $^O ne 'darwin' ) {
37 say "If you run Enbld at Linux or BSD, there is a possibility " .
38 "that the Software which depends is not installed.";
39 }
40  
41 say "\nPlease check build logile:" . Enbld::Logger->logfile;
42  
43 return;
44 }
45 );
46  
47 if ( $installed ) {
48 Enbld::App::Configuration->set_config( $installed );
49 }
50  
51 $self->teardown;
52  
53 return $installed;
54 }
55  
56 1;