dbMan/Extension/Fallback.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 43 CC 5 SCAR 28.7
CC
5
Cov
0%
handle_action
30.0
IDENTIFICATION
2.0
preference
2.0
CRAP 17.6
1 package DBIx::dbMan::Extension::Fallback;
2  
3 use strict;
4 use base 'DBIx::dbMan::Extension';
5  
6 our $VERSION = '0.05';
7  
8 1;
9  
10 sub IDENTIFICATION { return "000001-000002-000005"; }
11  
12 sub preference { return -99999; }
13  
14 sub handle_action {
15 my ($obj,%action) = @_;
16  
17 $action{processed} = 1;
18  
19 $action{action} = 'NONE' if $action{action} eq 'IDLE';
20  
21 # Not handled command
22 if ($action{action} eq 'COMMAND') {
23 $action{action} = 'OUTPUT';
24 $action{output} = '';
25 $obj->{-interface}->error( "Unknown command (".$action{cmd}.")." );
26 delete $action{processed};
27 } elsif (not $action{action}) { # internal - incorrect handling of action
28 $obj->{-interface}->print("INTERNAL: Action not correctly handled by some extension!\n");
29 } elsif ($action{action} ne 'NONE' and $action{action} ne 'QUIT') { # internal - action not handled
30 $obj->{-interface}->print("INTERNAL: Not handled action $action{action}.\n");
31 $action{action} = 'NONE';
32 }
33  
34 return %action;
35 }