[Bast-commits] r7619 - in DBIx-Class-Cursor-Cached/1.000/trunk: .
lib/DBIx/Class/Cursor t
bluefeet at dev.catalyst.perl.org
bluefeet at dev.catalyst.perl.org
Thu Sep 10 16:22:58 GMT 2009
Author: bluefeet
Date: 2009-09-10 16:22:57 +0000 (Thu, 10 Sep 2009)
New Revision: 7619
Added:
DBIx-Class-Cursor-Cached/1.000/trunk/Changes
Modified:
DBIx-Class-Cursor-Cached/1.000/trunk/Makefile.PL
DBIx-Class-Cursor-Cached/1.000/trunk/lib/DBIx/Class/Cursor/Cached.pm
DBIx-Class-Cursor-Cached/1.000/trunk/t/simple.t
Log:
Apply version 1.0.1 from CPAN.
Added: DBIx-Class-Cursor-Cached/1.000/trunk/Changes
===================================================================
--- DBIx-Class-Cursor-Cached/1.000/trunk/Changes (rev 0)
+++ DBIx-Class-Cursor-Cached/1.000/trunk/Changes 2009-09-10 16:22:57 UTC (rev 7619)
@@ -0,0 +1,7 @@
+Revision history for DBIx::Class::Cursor::Cached
+
+1.0.1 7 August 2007 12:37:00
+ - Fixed bug in next() as spotted by atsushi kobayashi
+
+1.0.0 6 August 2007 17:38:00
+ - initial release
Modified: DBIx-Class-Cursor-Cached/1.000/trunk/Makefile.PL
===================================================================
--- DBIx-Class-Cursor-Cached/1.000/trunk/Makefile.PL 2009-09-10 06:06:45 UTC (rev 7618)
+++ DBIx-Class-Cursor-Cached/1.000/trunk/Makefile.PL 2009-09-10 16:22:57 UTC (rev 7619)
@@ -3,11 +3,15 @@
use inc::Module::Install 0.67;
name 'DBIx-Class-Cursor-Cached';
+version '1.0.1';
all_from 'lib/DBIx/Class/Cursor/Cached.pm';
requires 'DBIx::Class' => '0.08004';
requires 'Digest::SHA1';
+build_requires 'Test::More';
+build_requires 'Cache::FileCache';
+
auto_install;
WriteAll;
Modified: DBIx-Class-Cursor-Cached/1.000/trunk/lib/DBIx/Class/Cursor/Cached.pm
===================================================================
--- DBIx-Class-Cursor-Cached/1.000/trunk/lib/DBIx/Class/Cursor/Cached.pm 2009-09-10 06:06:45 UTC (rev 7618)
+++ DBIx-Class-Cursor-Cached/1.000/trunk/lib/DBIx/Class/Cursor/Cached.pm 2009-09-10 16:22:57 UTC (rev 7619)
@@ -8,7 +8,7 @@
use vars qw($VERSION);
-$VERSION = '0.999001_01';
+$VERSION = '1.000001';
sub new {
my $class = shift;
@@ -34,7 +34,7 @@
sub next {
my ($self) = @_;
- return @{($self->{data} ||= $self->_fill_data)->{$self->{pos}++}||[]};
+ return @{($self->{data} ||= $self->_fill_data)->[$self->{pos}++]||[]};
}
sub all {
Modified: DBIx-Class-Cursor-Cached/1.000/trunk/t/simple.t
===================================================================
--- DBIx-Class-Cursor-Cached/1.000/trunk/t/simple.t 2009-09-10 06:06:45 UTC (rev 7618)
+++ DBIx-Class-Cursor-Cached/1.000/trunk/t/simple.t 2009-09-10 16:22:57 UTC (rev 7619)
@@ -46,14 +46,13 @@
use DBIx::Class::Cursor::Cached;
use Test::More 'no_plan';
+mkdir('t/var');
unlink('t/var/test.db');
my ($dsn, $user, $pass) = ('dbi:SQLite:t/var/test.db');
SchemaClass->connect($dsn,$user,$pass)->init;
-require Data::Dumper;
-
my $expect_data = [ [ 1, 'CD one' ], [ 2, 'CD two' ] ];
{ ## start test block
@@ -94,7 +93,7 @@
ok(!defined($cache->get($rs->cursor->cache_key)), 'cache cleared');
- @cds = $rs->all; # refills cache
+ @cds = (); while (my $rec = $rs->next) { push(@cds, $rec); }
is_deeply([ map { [ $_->id, $_->title ] } @cds ], $expect_data,
'correct data in objects');
More information about the Bast-commits
mailing list