r54645 - in /branches/upstream/libredis-perl/current: Changes META.yml Makefile.PL lib/Redis.pm
eloy at users.alioth.debian.org
eloy at users.alioth.debian.org
Mon Mar 22 11:28:00 UTC 2010
Author: eloy
Date: Mon Mar 22 11:27:31 2010
New Revision: 54645
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54645
Log:
[svn-upgrade] Integrating new upstream version, libredis-perl (1.2001)
Modified:
branches/upstream/libredis-perl/current/Changes
branches/upstream/libredis-perl/current/META.yml
branches/upstream/libredis-perl/current/Makefile.PL
branches/upstream/libredis-perl/current/lib/Redis.pm
Modified: branches/upstream/libredis-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/Changes?rev=54645&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/Changes (original)
+++ branches/upstream/libredis-perl/current/Changes Mon Mar 22 11:27:31 2010
@@ -6,3 +6,8 @@
0.08 Tue Mar 24 22:38:59 CET 2009
This version supports new protocol introduced in beta 8
Version bump to be in-sync with Redis version
+
+1.2001 Wed Mar 17 17:22:01 CET 2010
+ Redis protocol 1.2 support by Jeremy Zawodny <Jeremy at Zawodny.com> CPAN RT #54841
+ Version bump to be in-sync with Redis version
+ Correctly round-trip utf-8 encoded characters
Modified: branches/upstream/libredis-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/META.yml?rev=54645&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/META.yml (original)
+++ branches/upstream/libredis-perl/current/META.yml Mon Mar 22 11:27:31 2010
@@ -1,17 +1,26 @@
--- #YAML:1.0
-name: Redis
-version: 0.0801
-abstract: perl binding for Redis database
-license: ~
-author:
+name: Redis
+version: 1.2001
+abstract: perl binding for Redis database
+author:
- Dobrica Pavlinusic <dpavlin at rot13.org>
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
- Carp: 0
- Data::Dumper: 0
- IO::Socket::INET: 0
- Test::More: 0
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Carp: 0
+ Data::Dumper: 0
+ Encode: 0
+ IO::Socket::INET: 0
+ Test::More: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libredis-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/Makefile.PL?rev=54645&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/Makefile.PL (original)
+++ branches/upstream/libredis-perl/current/Makefile.PL Mon Mar 22 11:27:31 2010
@@ -13,6 +13,7 @@
'IO::Socket::INET' => 0,
'Data::Dumper' => 0,
'Carp' => 0,
+ 'Encode' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Redis-*' },
Modified: branches/upstream/libredis-perl/current/lib/Redis.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libredis-perl/current/lib/Redis.pm?rev=54645&op=diff
==============================================================================
--- branches/upstream/libredis-perl/current/lib/Redis.pm (original)
+++ branches/upstream/libredis-perl/current/lib/Redis.pm Mon Mar 22 11:27:31 2010
@@ -6,6 +6,7 @@
use IO::Socket::INET;
use Data::Dumper;
use Carp qw/confess/;
+use Encode;
=head1 NAME
@@ -13,14 +14,14 @@
=cut
-our $VERSION = '0.0801';
+our $VERSION = '1.2001';
=head1 DESCRIPTION
Pure perl bindings for L<http://code.google.com/p/redis/>
-This version support git version 0.08 or later of Redis available at
+This version supports protocol 1.2 or later of Redis available at
L<git://github.com/antirez/redis>
@@ -61,6 +62,13 @@
sadd => 1, srem => 1,
sismember => 1,
echo => 1,
+ getset => 1,
+ smove => 1,
+ zadd => 1,
+ zrem => 1,
+ zscore => 1,
+ zincrby => 1,
+ append => 1,
};
# we don't want DESTROY to fallback into AUTOLOAD
@@ -69,6 +77,8 @@
our $AUTOLOAD;
sub AUTOLOAD {
my $self = shift;
+
+ use bytes;
my $sock = $self->{sock} || die "no server connected";
@@ -108,6 +118,7 @@
}
my $result = <$sock> || die "can't read socket: $!";
+ Encode::_utf8_on($result);
warn "<< $result" if $self->{debug};
my $type = substr($result,0,1);
$result = substr($result,1,-2);
@@ -126,7 +137,7 @@
}
if ( $type eq '-' ) {
- confess $result;
+ confess "[$command] $result";
} elsif ( $type eq '+' ) {
return $result;
} elsif ( $type eq '$' ) {
@@ -147,6 +158,7 @@
my $v;
if ( $len > 0 ) {
read($self->{sock}, $v, $len) || die $!;
+ Encode::_utf8_on($v);
warn "<< ",Dumper($v),$/ if $self->{debug};
}
my $crlf;
@@ -360,6 +372,14 @@
my $info_hash = $r->info;
+=head1 ENCODING
+
+Since Redis knows nothing about encoding, we are forcing utf-8 flag on all data received from Redis.
+This change is introduced in 1.2001 version.
+
+This allows us to round-trip utf-8 encoded characters correctly, but might be problem if you push
+binary junk into Redis and expect to get it back without utf-8 flag turned on.
+
=head1 AUTHOR
Dobrica Pavlinusic, C<< <dpavlin at rot13.org> >>
@@ -410,7 +430,7 @@
=head1 COPYRIGHT & LICENSE
-Copyright 2009 Dobrica Pavlinusic, all rights reserved.
+Copyright 2009-2010 Dobrica Pavlinusic, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
More information about the Pkg-perl-cvs-commits
mailing list