diff -Nru liborlite-perl-1.50/Changes liborlite-perl-1.51/Changes --- liborlite-perl-1.50/Changes 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/Changes 2011-11-25 02:52:36.000000000 +0000 @@ -1,5 +1,11 @@ Changes for Perl extension ORLite +1.51 Fri 25 Nov 2011 + - Module::Install::DSL updated to 1.04 + - Automatically load overlay classes if there exist. That is, where a + Foo/TableName.pm module exists in addition to the automatically + generated Foo::TableName class. + 1.50 Tue 7 Jun 2011 - Removed normalize as a supported parameter, normalizing columns turns out not to work in practice. However, we always normalize tables to diff -Nru liborlite-perl-1.50/debian/changelog liborlite-perl-1.51/debian/changelog --- liborlite-perl-1.50/debian/changelog 2011-06-08 15:35:30.000000000 +0000 +++ liborlite-perl-1.51/debian/changelog 2011-11-25 13:44:19.000000000 +0000 @@ -1,3 +1,23 @@ +liborlite-perl (1.51-1) unstable; urgency=low + + [ Ansgar Burchardt ] + * debian/control: Convert Vcs-* fields to Git. + + [ Salvatore Bonaccorso ] + * debian/copyright: Replace DEP5 Format-Specification URL from + svn.debian.org to anonscm.debian.org URL. + + [ gregor herrmann ] + * Remove debian/source/local-options; abort-on-upstream-changes and + unapply-patches are default in dpkg-source since 1.16.1. + + [ Angel Abad ] + * Imported Upstream version 1.51 + * debian/copyright: Update debian/* section + * debian/patches/fix_pod_spelling: Refresh patch + + -- Angel Abad Fri, 25 Nov 2011 14:19:10 +0100 + liborlite-perl (1.50-1) unstable; urgency=low [ Angel Abad ] diff -Nru liborlite-perl-1.50/debian/control liborlite-perl-1.51/debian/control --- liborlite-perl-1.50/debian/control 2011-05-04 17:14:48.000000000 +0000 +++ liborlite-perl-1.51/debian/control 2011-11-25 13:44:19.000000000 +0000 @@ -1,16 +1,6 @@ Source: liborlite-perl Section: perl Priority: optional -Build-Depends: debhelper (>= 8) -Build-Depends-Indep: libclass-xsaccessor-perl, - libdbd-sqlite3-perl (>= 1.27), - libdbi-perl (>= 1.607), - perl (>= 5.11.1) | libfile-path-perl, - libfile-remove-perl, - libparams-util-perl (>= 0.33), - libtest-script-perl, - perl, - perl (>= 5.10.1) | libfile-temp-perl Maintainer: Debian Perl Group Uploaders: Damyan Ivanov , Brian Cassidy , @@ -22,20 +12,30 @@ Ansgar Burchardt , Franck Joncourt , Angel Abad +Build-Depends: debhelper (>= 8) +Build-Depends-Indep: libclass-xsaccessor-perl, + libdbd-sqlite3-perl (>= 1.27), + libdbi-perl (>= 1.607), + libfile-remove-perl, + libparams-util-perl (>= 0.33), + libtest-script-perl, + perl, + perl (>= 5.10.1) | libfile-temp-perl, + perl (>= 5.11.1) | libfile-path-perl Standards-Version: 3.9.2 +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/liborlite-perl.git +Vcs-Git: git://git.debian.org/pkg-perl/packages/liborlite-perl.git Homepage: http://search.cpan.org/dist/ORLite/ -Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liborlite-perl/ -Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/liborlite-perl/ Package: liborlite-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, libdbd-sqlite3-perl (>= 1.27), libdbi-perl (>= 1.607), - perl (>= 5.11.1) | libfile-path-perl, libfile-remove-perl, libparams-util-perl (>= 0.33), - perl (>= 5.10.1) | libfile-temp-perl + perl (>= 5.10.1) | libfile-temp-perl, + perl (>= 5.11.1) | libfile-path-perl Suggests: libclass-xsaccessor-perl Description: lightweight SQLite-specific ORM ORLite is a Perl module that implements an object-relational mapper designed diff -Nru liborlite-perl-1.50/debian/copyright liborlite-perl-1.51/debian/copyright --- liborlite-perl-1.50/debian/copyright 2011-06-07 14:47:23.000000000 +0000 +++ liborlite-perl-1.51/debian/copyright 2011-11-25 13:44:19.000000000 +0000 @@ -1,4 +1,4 @@ -Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Format-Specification: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?view=markup&pathrev=135 Maintainer: Adam Kennedy Source: http://search.cpan.org/dist/ORLite/ Name: ORLite @@ -22,9 +22,9 @@ 2009, Nathan Handler 2009, Rene Mayorga 2010-2011, Angel Abad - 2010, Ansgar Burchardt 2010, Franck Joncourt 2010-2011, gregor herrmann + 2010-2011, Ansgar Burchardt License: Artistic or GPL-1+ License: Artistic diff -Nru liborlite-perl-1.50/debian/patches/fix_pod_spelling liborlite-perl-1.51/debian/patches/fix_pod_spelling --- liborlite-perl-1.50/debian/patches/fix_pod_spelling 2011-06-08 15:35:14.000000000 +0000 +++ liborlite-perl-1.51/debian/patches/fix_pod_spelling 2011-11-25 13:44:19.000000000 +0000 @@ -7,7 +7,7 @@ --- a/lib/ORLite.pm +++ b/lib/ORLite.pm -@@ -1076,7 +1076,7 @@ +@@ -1082,7 +1082,7 @@ overriding method difficult. The C option will make ORLite generate all of it's methods into a diff -Nru liborlite-perl-1.50/inc/Module/Install/Base.pm liborlite-perl-1.51/inc/Module/Install/Base.pm --- liborlite-perl-1.50/inc/Module/Install/Base.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/Base.pm 2011-11-25 02:53:17.000000000 +0000 @@ -4,7 +4,7 @@ use strict 'vars'; use vars qw{$VERSION}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; } # Suspend handler for "redefined" warnings diff -Nru liborlite-perl-1.50/inc/Module/Install/Can.pm liborlite-perl-1.51/inc/Module/Install/Can.pm --- liborlite-perl-1.50/inc/Module/Install/Can.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/Can.pm 2011-11-25 02:53:17.000000000 +0000 @@ -9,7 +9,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru liborlite-perl-1.50/inc/Module/Install/DSL.pm liborlite-perl-1.51/inc/Module/Install/DSL.pm --- liborlite-perl-1.50/inc/Module/Install/DSL.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/DSL.pm 2011-11-25 02:53:17.000000000 +0000 @@ -4,7 +4,7 @@ use strict; use vars qw{$VERSION $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; $ISCORE = 1; *inc::Module::Install::DSL::VERSION = *VERSION; @inc::Module::Install::DSL::ISA = __PACKAGE__; @@ -59,7 +59,8 @@ my @lines = grep { /\S/ } split /[\012\015]+/, $dsl; # Each line represents one command - my @code = (); + my @code = (); + my $static = 1; foreach my $line ( @lines ) { # Split the lines into tokens my @tokens = split /\s+/, $line; @@ -74,6 +75,10 @@ # This is the beginning of a suffix push @suffix, $token; push @suffix, @tokens; + + # The conditional means this distribution + # can no longer be considered fully static. + $static = 0; last; } else { # Convert to a string @@ -87,6 +92,9 @@ push @code, join( ' ', @tokens ) . ";\n"; } + # Is our configuration static? + push @code, "static_config;\n" if $static; + # Join into the complete code block return join( '', @code ); } diff -Nru liborlite-perl-1.50/inc/Module/Install/Fetch.pm liborlite-perl-1.51/inc/Module/Install/Fetch.pm --- liborlite-perl-1.50/inc/Module/Install/Fetch.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/Fetch.pm 2011-11-25 02:53:17.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru liborlite-perl-1.50/inc/Module/Install/Makefile.pm liborlite-perl-1.51/inc/Module/Install/Makefile.pm --- liborlite-perl-1.50/inc/Module/Install/Makefile.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/Makefile.pm 2011-11-25 02:53:17.000000000 +0000 @@ -8,7 +8,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -219,14 +219,14 @@ # an underscore, even though its own version may contain one! # Hence the funny regexp to get rid of it. See RT #35800 # for details. - my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/; + my ($v) = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/; $self->build_requires( 'ExtUtils::MakeMaker' => $v ); $self->configure_requires( 'ExtUtils::MakeMaker' => $v ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. - $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 ); - $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 ); + $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); + $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params @@ -241,7 +241,6 @@ 'all_from' if you prefer) in Makefile.PL. EOT - $DB::single = 1; if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; @@ -412,4 +411,4 @@ __END__ -#line 541 +#line 540 diff -Nru liborlite-perl-1.50/inc/Module/Install/Metadata.pm liborlite-perl-1.51/inc/Module/Install/Metadata.pm --- liborlite-perl-1.50/inc/Module/Install/Metadata.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/Metadata.pm 2011-11-25 02:53:17.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -151,15 +151,21 @@ sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { - my $self = shift; - unless ( @_ ) { - warn "You MUST provide an explicit true/false value to dynamic_config\n"; - return $self; + my $self = shift; + my $value = @_ ? shift : 1; + if ( $self->{values}->{dynamic_config} ) { + # Once dynamic we never change to static, for safety + return 0; } - $self->{values}->{dynamic_config} = $_[0] ? 1 : 0; + $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } +# Convenience command +sub static_config { + shift->dynamic_config(0); +} + sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; @@ -170,7 +176,7 @@ # Normalize the version $version = $self->_perl_version($version); - # We don't support the reall old versions + # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } @@ -582,7 +588,7 @@ sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); - my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; + my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; diff -Nru liborlite-perl-1.50/inc/Module/Install/Win32.pm liborlite-perl-1.51/inc/Module/Install/Win32.pm --- liborlite-perl-1.50/inc/Module/Install/Win32.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/Win32.pm 2011-11-25 02:53:17.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru liborlite-perl-1.50/inc/Module/Install/With.pm liborlite-perl-1.51/inc/Module/Install/With.pm --- liborlite-perl-1.50/inc/Module/Install/With.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/With.pm 2011-11-25 02:53:17.000000000 +0000 @@ -8,7 +8,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru liborlite-perl-1.50/inc/Module/Install/WriteAll.pm liborlite-perl-1.51/inc/Module/Install/WriteAll.pm --- liborlite-perl-1.50/inc/Module/Install/WriteAll.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install/WriteAll.pm 2011-11-25 02:53:17.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.01'; + $VERSION = '1.04'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } diff -Nru liborlite-perl-1.50/inc/Module/Install.pm liborlite-perl-1.51/inc/Module/Install.pm --- liborlite-perl-1.50/inc/Module/Install.pm 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/inc/Module/Install.pm 2011-11-25 02:53:16.000000000 +0000 @@ -31,7 +31,7 @@ # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '1.01'; + $VERSION = '1.04'; # Storage for the pseudo-singleton $MAIN = undef; @@ -451,7 +451,7 @@ } sub _cmp ($$) { - _version($_[0]) <=> _version($_[1]); + _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS diff -Nru liborlite-perl-1.50/lib/ORLite.pm liborlite-perl-1.51/lib/ORLite.pm --- liborlite-perl-1.50/lib/ORLite.pm 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/lib/ORLite.pm 2011-11-25 02:52:36.000000000 +0000 @@ -14,7 +14,7 @@ use vars qw{$VERSION}; BEGIN { - $VERSION = '1.50'; + $VERSION = '1.51'; } # Support for the 'prune' option @@ -337,9 +337,10 @@ } # Optionally generate the table classes + my $tables = undef; if ( $params{tables} ) { # Capture the raw schema table information - my $tables = $dbh->selectall_arrayref( + $tables = $dbh->selectall_arrayref( 'select * from sqlite_master where name not like ? and type in ( ?, ? )', { Slice => {} }, 'sqlite_%', 'table', 'view', ); @@ -711,26 +712,26 @@ } } - # Optionally generate the table classes - if ( $params{views} ) { - # Capture the raw schema table information - my $views = $dbh->selectall_arrayref( - 'select * from sqlite_master where name not like ? and type = ?', - { Slice => {} }, 'sqlite_%', 'view', - ); - my %vindex = map { $_->{name} => $_ } @$views; + # We are finished with the database + $dbh->disconnect; - 1; - } + # Start the post-table content again + $code .= "\npackage $pkg;\n" if $params{tables}; - # We are finished with it now - $dbh->disconnect; + # Append any custom code for the user + $code .= "\n$params{append}" if defined $params{append}; - # Add any custom code to the end - if ( defined $params{append} ) { - $code .= "\npackage $pkg;\n" if $params{tables}; - $code .= "\n$params{append}"; + # Load the overload classes for each of the tables + if ( $tables ) { + $code .= join( "\n", + "local \$@ = undef;", + map { + "eval { require $_->{class} };" + } @$tables + ); } + + # End the class normally $code .= "\n\n1;\n"; # Save to the cache location if caching is enabled @@ -872,13 +873,18 @@ In the simplest form, your target root package "uses" ORLite, which will do the schema discovery and code generation at compile-time. -When called, ORLite generates two types of package. +When called, ORLite generates two types of packages. Firstly, it builds database connectivity, transaction support, and other purely database level functionality into your root namespace. -Then it will create one sub-package underneath the root package for each -table contained in the database. +Secondly, it will create one sub-package underneath the namespace of the root +module for each table or view it finds in the database. + +Once the basic table support has been generated, it will also try to load an +"overlay" module of the same name. Thus, by created a Foo::TableName module on +disk containing "extra" code, you can extend the original and add additional +functionality to it. =head1 OPTIONS diff -Nru liborlite-perl-1.50/Makefile.PL liborlite-perl-1.51/Makefile.PL --- liborlite-perl-1.50/Makefile.PL 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/Makefile.PL 2011-11-25 02:52:36.000000000 +0000 @@ -1,4 +1,4 @@ -use inc::Module::Install::DSL 1.01; +use inc::Module::Install::DSL 1.04; all_from lib/ORLite.pm requires_from lib/ORLite.pm diff -Nru liborlite-perl-1.50/MANIFEST liborlite-perl-1.51/MANIFEST --- liborlite-perl-1.50/MANIFEST 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/MANIFEST 2011-11-25 02:53:17.000000000 +0000 @@ -14,6 +14,7 @@ Makefile.PL MANIFEST This list of files META.yml +MYMETA.json README t/01_compile.t t/02_basics.sql @@ -45,6 +46,8 @@ t/20_shim.t t/21_normalize.sql t/21_normalize.t +t/22_overlay.t +t/lib/TableOne.pm t/lib/Test.pm xt/meta.t xt/pmv.t diff -Nru liborlite-perl-1.50/META.yml liborlite-perl-1.51/META.yml --- liborlite-perl-1.50/META.yml 2011-06-07 08:58:50.000000000 +0000 +++ liborlite-perl-1.51/META.yml 2011-11-25 02:53:17.000000000 +0000 @@ -3,13 +3,14 @@ author: - 'Adam Kennedy ' build_requires: - ExtUtils::MakeMaker: 6.42 + ExtUtils::MakeMaker: 6.62 Test::More: 0.47 Test::Script: 1.06 configure_requires: - ExtUtils::MakeMaker: 6.42 + ExtUtils::MakeMaker: 6.62 distribution_type: module -generated_by: 'Module::Install version 1.01' +dynamic_config: 1 +generated_by: 'Module::Install version 1.04' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -35,4 +36,4 @@ ChangeLog: http://fisheye2.atlassian.com/changelog/cpan/trunk/ORLite license: http://dev.perl.org/licenses/ repository: http://svn.ali.as/cpan/trunk/ORLite -version: 1.50 +version: 1.51 diff -Nru liborlite-perl-1.50/MYMETA.json liborlite-perl-1.51/MYMETA.json --- liborlite-perl-1.50/MYMETA.json 1970-01-01 00:00:00.000000000 +0000 +++ liborlite-perl-1.51/MYMETA.json 2011-11-25 02:53:17.000000000 +0000 @@ -0,0 +1,62 @@ +{ + "abstract" : "Extremely light weight SQLite-specific ORM", + "author" : [ + "Adam Kennedy " + ], + "dynamic_config" : 0, + "generated_by" : "Module::Install version 1.04, CPAN::Meta::Converter version 2.112621", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "ORLite", + "no_index" : { + "directory" : [ + "inc", + "t", + "xt" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "ExtUtils::MakeMaker" : "6.62", + "Test::More" : "0.47", + "Test::Script" : "1.06" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : "6.62" + } + }, + "runtime" : { + "requires" : { + "DBD::SQLite" : "1.27", + "DBI" : "1.607", + "File::Basename" : 0, + "File::Path" : "2.08", + "File::Remove" : "1.40", + "File::Spec" : "0.80", + "File::Temp" : "0.20", + "Params::Util" : "0.33", + "perl" : "5.006" + } + } + }, + "release_status" : "stable", + "resources" : { + "license" : [ + "http://dev.perl.org/licenses/" + ], + "repository" : { + "url" : "http://svn.ali.as/cpan/trunk/ORLite" + }, + "x_ChangeLog" : "http://fisheye2.atlassian.com/changelog/cpan/trunk/ORLite" + }, + "version" : "1.51", + "x_module_name" : "ORLite" +} diff -Nru liborlite-perl-1.50/README liborlite-perl-1.51/README --- liborlite-perl-1.50/README 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/README 2011-11-25 02:52:36.000000000 +0000 @@ -71,13 +71,18 @@ In the simplest form, your target root package "uses" ORLite, which will do the schema discovery and code generation at compile-time. - When called, ORLite generates two types of package. + When called, ORLite generates two types of packages. Firstly, it builds database connectivity, transaction support, and other purely database level functionality into your root namespace. - Then it will create one sub-package underneath the root package for each - table contained in the database. + Secondly, it will create one sub-package underneath the namespace of the + root module for each table or view it finds in the database. + + Once the basic table support has been generated, it will also try to + load an "overlay" module of the same name. Thus, by created a + Foo::TableName module on disk containing "extra" code, you can extend + the original and add additional functionality to it. OPTIONS ORLite takes a set of options for the class construction at compile time diff -Nru liborlite-perl-1.50/t/08_prune.pl liborlite-perl-1.51/t/08_prune.pl --- liborlite-perl-1.50/t/08_prune.pl 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/t/08_prune.pl 2011-11-25 02:52:36.000000000 +0000 @@ -4,7 +4,7 @@ use strict; -our $VERSION = '1.50'; +our $VERSION = '1.51'; unless ( $ORLite::VERSION eq $VERSION ) { die('Failed to load correct ORLite version'); diff -Nru liborlite-perl-1.50/t/17_cache.t liborlite-perl-1.51/t/17_cache.t --- liborlite-perl-1.50/t/17_cache.t 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/t/17_cache.t 2011-11-25 02:52:36.000000000 +0000 @@ -14,7 +14,7 @@ use t::lib::Test; # Where will the cache file be written to -my $cached = catfile( qw{ t Foo-Bar-1-23-ORLite-1-50-user_version-2.pm } ); +my $cached = catfile( qw{ t Foo-Bar-1-23-ORLite-1-51-user_version-2.pm } ); clear($cached); ok( ! -e $cached, 'Cache file does not initially exist' ); diff -Nru liborlite-perl-1.50/t/19_view.t liborlite-perl-1.51/t/19_view.t --- liborlite-perl-1.50/t/19_view.t 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/t/19_view.t 2011-11-25 02:52:36.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Tests the basic functionality of SQLite. +# Tests support for views use strict; diff -Nru liborlite-perl-1.50/t/22_overlay.t liborlite-perl-1.51/t/22_overlay.t --- liborlite-perl-1.50/t/22_overlay.t 1970-01-01 00:00:00.000000000 +0000 +++ liborlite-perl-1.51/t/22_overlay.t 2011-11-25 02:52:36.000000000 +0000 @@ -0,0 +1,74 @@ +#!/usr/bin/perl + +# Tests that overlay modules are automatically loaded + +BEGIN { + $| = 1; + $^W = 1; +} + +use Test::More tests => 7; +use File::Spec::Functions ':ALL'; +use t::lib::Test; + + + + + +##################################################################### +# Set up for testing + +# Connect +my $file = test_db(); +my $dbh = create_ok( + file => catfile(qw{ t 02_basics.sql }), + connect => [ "dbi:SQLite:$file" ], +); + +# Create the test package +eval <<"END_PERL"; die $@ if $@; +package t::lib; + +use strict; +use ORLite { + file => '$file', +}; + +1; +END_PERL + + + + + +##################################################################### +# Tests for the base package update methods + +isa_ok( + t::lib::TableOne->create( + col1 => 1, + col2 => 'foo', + ), + 't::lib::TableOne', +); + +isa_ok( + t::lib::TableOne->create( + col1 => 2, + col2 => 'bar', + ), + 't::lib::TableOne', +); +is( t::lib::TableOne->count, 2, 'Found 2 rows' ); + +is( + t::lib::TableOne->count, + 2, + 'Count found 2 rows', +); + +SCOPE: { + my $object = t::lib::TableOne->load(1); + isa_ok( $object, 't::lib::TableOne' ); + is( $object->dummy, 2, '->dummy ok (overlay was loaded)' ); +} diff -Nru liborlite-perl-1.50/t/lib/TableOne.pm liborlite-perl-1.51/t/lib/TableOne.pm --- liborlite-perl-1.50/t/lib/TableOne.pm 1970-01-01 00:00:00.000000000 +0000 +++ liborlite-perl-1.51/t/lib/TableOne.pm 2011-11-25 02:52:36.000000000 +0000 @@ -0,0 +1,9 @@ +package t::lib::TableOne; + +use strict; + +sub dummy { + return 2; +} + +1; diff -Nru liborlite-perl-1.50/t/lib/Test.pm liborlite-perl-1.51/t/lib/Test.pm --- liborlite-perl-1.50/t/lib/Test.pm 2011-06-07 08:58:06.000000000 +0000 +++ liborlite-perl-1.51/t/lib/Test.pm 2011-11-25 02:52:36.000000000 +0000 @@ -9,7 +9,7 @@ use vars qw{$VERSION @ISA @EXPORT}; BEGIN { - $VERSION = '1.50'; + $VERSION = '1.51'; @ISA = 'Exporter'; @EXPORT = qw{ test_db connect_ok create_ok }; }