r29781 - in /branches/upstream/libnet-amazon-s3-perl/current: CHANGES META.yml lib/Net/Amazon/S3.pm lib/Net/Amazon/S3/Client/Bucket.pm t/02client.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sat Jan 17 22:13:52 UTC 2009
Author: gregoa
Date: Sat Jan 17 22:13:49 2009
New Revision: 29781
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29781
Log:
[svn-upgrade] Integrating new upstream version, libnet-amazon-s3-perl (0.49)
Modified:
branches/upstream/libnet-amazon-s3-perl/current/CHANGES
branches/upstream/libnet-amazon-s3-perl/current/META.yml
branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3.pm
branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3/Client/Bucket.pm
branches/upstream/libnet-amazon-s3-perl/current/t/02client.t
Modified: branches/upstream/libnet-amazon-s3-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-amazon-s3-perl/current/CHANGES?rev=29781&op=diff
==============================================================================
--- branches/upstream/libnet-amazon-s3-perl/current/CHANGES (original)
+++ branches/upstream/libnet-amazon-s3-perl/current/CHANGES Sat Jan 17 22:13:49 2009
@@ -1,4 +1,8 @@
Revision history for Perl module Net::Amazon::S3:
+
+0.49 Tue Jan 13 09:04:42 GMT 2009
+ - add support for listing a bucket with a prefix to
+ Net::Amazon::S3::Client::Bucket
0.48 Thu Dec 4 09:24:23 GMT 2008
- be slightly less strict about bucket names: they can contain uppercase
Modified: branches/upstream/libnet-amazon-s3-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-amazon-s3-perl/current/META.yml?rev=29781&op=diff
==============================================================================
--- branches/upstream/libnet-amazon-s3-perl/current/META.yml (original)
+++ branches/upstream/libnet-amazon-s3-perl/current/META.yml Sat Jan 17 22:13:49 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Net-Amazon-S3
-version: 0.48
+version: 0.49
abstract: Use the Amazon S3 - Simple Storage Service
license: perl
author:
Modified: branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3.pm?rev=29781&op=diff
==============================================================================
--- branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3.pm (original)
+++ branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3.pm Sat Jan 17 22:13:49 2009
@@ -140,7 +140,7 @@
has 'err' => ( is => 'rw', isa => 'Maybe[Str]', required => 0 );
has 'errstr' => ( is => 'rw', isa => 'Maybe[Str]', required => 0 );
-our $VERSION = '0.48';
+our $VERSION = '0.49';
my $KEEP_ALIVE_CACHESIZE = 10;
Modified: branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3/Client/Bucket.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3/Client/Bucket.pm?rev=29781&op=diff
==============================================================================
--- branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3/Client/Bucket.pm (original)
+++ branches/upstream/libnet-amazon-s3-perl/current/lib/Net/Amazon/S3/Client/Bucket.pm Sat Jan 17 22:13:49 2009
@@ -64,7 +64,9 @@
}
sub list {
- my $self = shift;
+ my ( $self, $conf ) = @_;
+ $conf ||= {};
+ my $prefix = $conf->{prefix};
my $marker = undef;
my $end = 0;
@@ -78,6 +80,7 @@
s3 => $self->client->s3,
bucket => $self->name,
marker => $marker,
+ prefix => $prefix,
)->http_request;
my $xpc = $self->client->_send_request_xpc($http_request);
@@ -163,6 +166,9 @@
}
}
+ # or list by a prefix
+ my $prefix_stream = $bucket->list( { prefix => 'logs/' } );
+
# returns a L<Net::Amazon::S3::Client::Object>, which can then
# be used to get or put
my $object = $bucket->object( key => 'this is the key' );
@@ -199,6 +205,9 @@
}
}
+ # or list by a prefix
+ my $prefix_stream = $bucket->list( { prefix => 'logs/' } );
+
=head2 location_constraint
# return the bucket location constraint
Modified: branches/upstream/libnet-amazon-s3-perl/current/t/02client.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-amazon-s3-perl/current/t/02client.t?rev=29781&op=diff
==============================================================================
--- branches/upstream/libnet-amazon-s3-perl/current/t/02client.t (original)
+++ branches/upstream/libnet-amazon-s3-perl/current/t/02client.t Sat Jan 17 22:13:49 2009
@@ -11,7 +11,7 @@
unless ( $ENV{'AMAZON_S3_EXPENSIVE_TESTS'} ) {
plan skip_all => 'Testing this module for real costs money.';
} else {
- plan tests => 31;
+ plan tests => 33;
}
use_ok('Net::Amazon::S3');
@@ -80,14 +80,33 @@
$object->put('this is the value');
my @objects;
-$stream = $bucket->list;
-until ( $stream->is_done ) {
- foreach my $object ( $stream->items ) {
- push @objects, $object;
- }
-}
-
-is( @objects, 1, 'have newly created key' );
+
+ at objects = ();
+$stream = $bucket->list( { prefix => 'this is the key' } );
+until ( $stream->is_done ) {
+ foreach my $object ( $stream->items ) {
+ push @objects, $object;
+ }
+}
+is( @objects, 1, 'bucket list with prefix finds key' );
+
+ at objects = ();
+$stream = $bucket->list( { prefix => 'this is not the key' } );
+until ( $stream->is_done ) {
+ foreach my $object ( $stream->items ) {
+ push @objects, $object;
+ }
+}
+is( @objects, 0, 'bucket list with different prefix does not find key' );
+
+ at objects = ();
+$stream = $bucket->list;
+until ( $stream->is_done ) {
+ foreach my $object ( $stream->items ) {
+ push @objects, $object;
+ }
+}
+is( @objects, 1, 'bucket list finds newly created key' );
is( $objects[0]->key,
'this is the key',
More information about the Pkg-perl-cvs-commits
mailing list