Storage/S3/Adapter/NetAmazonS3.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« CLI/S3Storage.pm ↑ Summary Storage/S3.pm »
1 package CPAN::MirrorMerger::Storage::S3::Adapter::NetAmazonS3;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 0 ▶use Class::Accessor::Lite ro => [qw/s3_bucket/], new => 1;
Subroutine BEGIN: called CC=1 SCAR=2.6
6  
7 sub exists :method {
8 my ($self, $key) = @_;
9 my $obj = $self->s3_bucket->object(key => $key);
10 return if $obj->exists();
11 }
12  
13 sub upload {
14 my ($self, $from_path, $save_key) = @_;
15 my $obj = $self->s3_bucket->object(key => $save_key);
16 $obj->put_filename($from_path);
17 }
18  
19 sub download {
20 my ($self, $save_key, $tempfile) = @_;
21 my $obj = $self->s3_bucket->object(key => $save_key);
22 return unless $obj->exists();
23  
24 $obj->get_filename("$tempfile");
25 return $tempfile;
26 }
27  
28 1;
29 __END__
« CLI/S3Storage.pm ↑ Summary Storage/S3.pm »