Database/DefaultCommandHelper.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 41 CC 2 SCAR 10.6
CC
2
Cov
0%
locate_file
6.0
new
2.0
allowed_destination
2.0
CRAP 2.9
1 use strict;
2 use warnings;
3  
4 package Footprintless::Plugin::Database::DefaultCommandHelper;
5 $Footprintless::Plugin::Database::DefaultCommandHelper::VERSION = '1.06';
6 # ABSTRACT: The default implementation of command helper for db
7 # PODNAME: Footprintless::Plugin::Database::DefaultCommandHelper
8  
9 use Carp;
10  
11 sub new {
12 return bless( {}, shift )->_init(@_);
13 }
14  
15 sub allowed_destination {
16 my ( $self, $coordinate ) = @_;
17 return 1;
18 }
19  
20 sub _init {
21 my ( $self, $footprintless ) = @_;
22 $self->{footprintless} = $footprintless;
23 return $self;
24 }
25  
26 sub locate_file {
27 my ( $self, $file ) = @_;
28 croak("file not found [$file]") unless ( -f $file );
29 return $file;
30 }
31  
32 sub post_restore {
33 my ( $self, $from_coordinate, $to_coordinate ) = @_;
34 my $file;
35 eval { $file = $self->locate_file("$from_coordinate-$to_coordinate.sql"); };
36 return $file;
37 }
38  
39 1;
40  
41 __END__