Enbld/Command/Rehash.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 46 SCAR 6.9
CC
1
Cov
0%
do
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Enbld::Command::Rehash;
2  
3 use strict;
4 use warnings;
5  
6 use parent qw/Enbld::Command/;
7  
8 use Try::Lite;
9  
10 require Enbld::Home;
11 require Enbld::Error;
12 require Enbld::App::Configuration;
13 require Enbld::Target;
14  
15 sub do {
16 my $self = shift;
17  
18 my $target_name = $self->validate_target_name( shift @{ $self->{argv} } );
19  
20 Enbld::Home->initialize;
21 Enbld::App::Configuration->read_file;
22  
23 my $config = Enbld::App::Configuration->search_config( $target_name );
24 my $target = Enbld::Target->new( $target_name, $config );
25  
26 try { $target->rehash } (
27 'Enbld::Error' => sub {
28 Enbld::Message->alert( $@ );
29 return;
30 }
31 );
32  
33 return $target_name;
34 }
35  
36 1;