File Coverage

lib/App/MtAws/QueueJob/Delete.pm
Criterion Covered Total %
statement 24 24 100.0
branch 4 4 100.0
condition n/a
subroutine 9 9 100.0
pod 0 3 0.0
total 37 40 92.5


line stmt bran cond sub pod time code
1             # mt-aws-glacier - Amazon Glacier sync client
2             # Copyright (C) 2012-2014 Victor Efimov
3             # http://mt-aws.com (also http://vs-dev.com) vs@vs-dev.com
4             # License: GPLv3
5             #
6             # This file is part of "mt-aws-glacier"
7             #
8             # mt-aws-glacier is free software: you can redistribute it and/or modify
9             # it under the terms of the GNU General Public License as published by
10             # the Free Software Foundation, either version 3 of the License, or
11             # (at your option) any later version.
12             #
13             # mt-aws-glacier is distributed in the hope that it will be useful,
14             # but WITHOUT ANY WARRANTY; without even the implied warranty of
15             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16             # GNU General Public License for more details.
17             #
18             # You should have received a copy of the GNU General Public License
19             # along with this program. If not, see <http://www.gnu.org/licenses/>.
20              
21             package App::MtAws::QueueJob::Delete;
22              
23             our $VERSION = '1.114_2';
24              
25 17     17   47625 use strict;
  17         27  
  17         459  
26 17     17   67 use warnings;
  17         22  
  17         386  
27 17     17   64 use Carp;
  17         22  
  17         775  
28              
29 17     17   74 use App::MtAws::QueueJobResult;
  17         36  
  17         1021  
30 17     17   149 use base 'App::MtAws::QueueJob';
  17         24  
  17         4538  
31              
32             sub init
33             {
34 21     21 0 27 my ($self) = @_;
35 21 100       135 defined($self->{relfilename}) || confess "no relfilename";
36 20 100       196 $self->{archive_id} || confess;
37 19         60 $self->enter('delete');
38             }
39              
40             sub on_delete
41             {
42 7     7 0 14 my ($self) = @_;
43             return state "wait", task "delete_archive", { archive_id => $self->{archive_id}, relfilename => $self->{relfilename} } => sub {
44 7     7   25 state("done")
45             }
46 7         24 }
47              
48             sub will_do
49             {
50 1     1 0 5 my ($self) = @_;
51 1         9 "Will DELETE archive $self->{archive_id} (filename $self->{relfilename})";
52             }
53              
54             1;