File Coverage

lib/App/MtAws/QueueJob/Retrieve.pm
Criterion Covered Total %
statement 24 24 100.0
branch 6 6 100.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 38 40 95.0


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::Retrieve;
22              
23             our $VERSION = '1.114_2';
24              
25 3     3   572 use strict;
  3         3  
  3         75  
26 3     3   9 use warnings;
  3         4  
  3         59  
27 3     3   10 use Carp;
  3         4  
  3         113  
28              
29 3     3   15 use App::MtAws::QueueJobResult;
  3         2  
  3         144  
30 3     3   43 use base 'App::MtAws::QueueJob';
  3         7  
  3         1029  
31              
32             sub init
33             {
34 10     10 0 15 my ($self) = @_;
35 10 100       318 defined($self->{relfilename}) || confess "no relfilename";
36 9 100       159 defined($self->{filename}) || confess "no filename";
37 8 100       147 $self->{archive_id} || confess;
38 7         24 $self->enter('retrieve');
39             }
40              
41             sub on_retrieve
42             {
43 4     4 0 6 my ($self) = @_;
44 12         62 return state "wait", task "retrieve_archive", { map { $_ => $self->{$_} } qw/archive_id relfilename filename/ } => sub { # TODO: filename unneeded?
45 4     4   22 state("done")
46             }
47 4         19 }
48              
49             1;