r67607 - in /trunk/liborlite-perl: Changes MANIFEST META.yml README debian/changelog debian/control debian/copyright debian/patches/ debian/patches/fix_pod_spelling debian/patches/series lib/ORLite.pm t/08_prune.pl t/17_cache.t t/20_shim.t t/lib/Test.pm

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Fri Jan 21 15:24:36 UTC 2011


Author: angelabad-guest
Date: Fri Jan 21 15:23:21 2011
New Revision: 67607

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67607
Log:
* New upstream release
* debian/control: Remove versioned depend on libfile-path-perl
* debian/copyright: Update copyright years
* debian/patches/fix_pod_spelling: New patch to fix spelling error in
  manpage

Added:
    trunk/liborlite-perl/debian/patches/
    trunk/liborlite-perl/debian/patches/fix_pod_spelling
    trunk/liborlite-perl/debian/patches/series
    trunk/liborlite-perl/t/20_shim.t
      - copied unchanged from r67592, branches/upstream/liborlite-perl/current/t/20_shim.t
Modified:
    trunk/liborlite-perl/Changes
    trunk/liborlite-perl/MANIFEST
    trunk/liborlite-perl/META.yml
    trunk/liborlite-perl/README
    trunk/liborlite-perl/debian/changelog
    trunk/liborlite-perl/debian/control
    trunk/liborlite-perl/debian/copyright
    trunk/liborlite-perl/lib/ORLite.pm
    trunk/liborlite-perl/t/08_prune.pl
    trunk/liborlite-perl/t/17_cache.t
    trunk/liborlite-perl/t/lib/Test.pm

Modified: trunk/liborlite-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/Changes?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/Changes (original)
+++ trunk/liborlite-perl/Changes Fri Jan 21 15:23:21 2011
@@ -1,4 +1,7 @@
 Changes for Perl extension ORLite
+
+1.48 Fri 21 Jan 2011
+	- Initial support for shim => 1 to simplify customisation (ADAMK)
 
 1.47 Wed 8 Dec 2010
 	- Adding readonly support for views (ADAMK)

Modified: trunk/liborlite-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/MANIFEST?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/MANIFEST (original)
+++ trunk/liborlite-perl/MANIFEST Fri Jan 21 15:23:21 2011
@@ -42,6 +42,7 @@
 t/18_update.t
 t/19_view.sql
 t/19_view.t
+t/20_shim.t
 t/lib/Test.pm
 xt/meta.t
 xt/pmv.t

Modified: trunk/liborlite-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/META.yml?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/META.yml (original)
+++ trunk/liborlite-perl/META.yml Fri Jan 21 15:23:21 2011
@@ -35,4 +35,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.47
+version: 1.48

Modified: trunk/liborlite-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/README?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/README (original)
+++ trunk/liborlite-perl/README Fri Jan 21 15:23:21 2011
@@ -235,7 +235,7 @@
     of generating it each time from scratch.
 
   cleanup
-    When working with embedded SQLite database containing rapidly changing
+    When working with embedded SQLite databases containing rapidly changing
     state data, it is important for database performance and general health
     to make sure you VACUUM or ANALYZE the database regularly.
 
@@ -260,6 +260,35 @@
     cleanup operation will be made pointless when "prune" deletes the file.
 
     By default, the "prune" option is set to false.
+
+  shim
+    In some situtations you may wish to make extensive changes to the
+    behaviour of the classes and methods generated by ORLite. Under normal
+    circumstances all code is generated into the table class directly, which
+    can make overriding method difficult.
+
+    The "shim" option will make ORLite generate all of it's methods into a
+    seperate "Foo::TableName::Shim" class, and leave the main table class
+    "Foo::TableName" as a transparent subclass of the shim.
+
+    This allows you to alter the behaviour of a table class without having
+    to do nasty tricks with symbol tables in order to alter or replace
+    methods.
+
+      package My::Person;
+      
+  # Write a log message when we create a new object
+      sub create {
+          my $class = shift;
+          my $self  = SUPER::create(@_);
+          my $name  = $self->name;
+          print LOG "Created new person '$name'\n";
+          return $self;
+      }
+
+    The "shim" option is global. It will alter the structure of all table
+    classes at once. However, unless you are making alterations to a class
+    the impact of this different class structure should be zero.
 
 ROOT PACKAGE METHODS
     All ORLite root packages receive an identical set of methods for
@@ -775,10 +804,10 @@
     Adam Kennedy <adamk at cpan.org>
 
 SEE ALSO
-    ORLite::Mirror, ORLite::Migrate
+    ORLite::Mirror, ORLite::Migrate, ORLite::Pod
 
 COPYRIGHT
-    Copyright 2008 - 2010 Adam Kennedy.
+    Copyright 2008 - 2011 Adam Kennedy.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.

Modified: trunk/liborlite-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/changelog?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/changelog (original)
+++ trunk/liborlite-perl/debian/changelog Fri Jan 21 15:23:21 2011
@@ -1,3 +1,13 @@
+liborlite-perl (1.48-1) unstable; urgency=low
+
+  * New upstream release
+  * debian/control: Remove versioned depend on libfile-path-perl
+  * debian/copyright: Update copyright years
+  * debian/patches/fix_pod_spelling: New patch to fix spelling error in
+    manpage
+
+ -- Angel Abad <angelabad at gmail.com>  Fri, 21 Jan 2011 16:22:57 +0100
+
 liborlite-perl (1.47-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/liborlite-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/control?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/control (original)
+++ trunk/liborlite-perl/debian/control Fri Jan 21 15:23:21 2011
@@ -2,17 +2,26 @@
 Section: perl
 Priority: optional
 Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: libclass-xsaccessor-perl, libdbd-sqlite3-perl (>= 1.27),
- libdbi-perl (>= 1.607), libfile-path-perl (>= 2.08),
- libfile-remove-perl, libparams-util-perl (>= 0.33),
- libtest-script-perl, perl,
+Build-Depends-Indep: libclass-xsaccessor-perl,
+ libdbd-sqlite3-perl (>= 1.27),
+ libdbi-perl (>= 1.607),
+ libfile-path-perl,
+ libfile-remove-perl,
+ libparams-util-perl (>= 0.33),
+ libtest-script-perl (>= 1.06),
+ perl,
  perl (>= 5.10.1) | libfile-temp-perl (>= 0.20)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Damyan Ivanov <dmn at debian.org>, Gunnar Wolf <gwolf at debian.org>,
- Brian Cassidy <brian.cassidy at gmail.com>, Rene Mayorga <rmayorga at debian.org>,
- Jaldhar H. Vyas <jaldhar at debian.org>, Nathan Handler <nhandler at ubuntu.com>,
- Jonathan Yu <jawnsy at cpan.org>, gregor herrmann <gregoa at debian.org>,
- Ansgar Burchardt <ansgar at debian.org>, Franck Joncourt <franck at debian.org>,
+Uploaders: Damyan Ivanov <dmn at debian.org>,
+ Gunnar Wolf <gwolf at debian.org>,
+ Brian Cassidy <brian.cassidy at gmail.com>,
+ Rene Mayorga <rmayorga at debian.org>,
+ Jaldhar H. Vyas <jaldhar at debian.org>,
+ Nathan Handler <nhandler at ubuntu.com>,
+ Jonathan Yu <jawnsy at cpan.org>,
+ gregor herrmann <gregoa at debian.org>,
+ Ansgar Burchardt <ansgar at debian.org>,
+ Franck Joncourt <franck at debian.org>,
  Angel Abad <angelabad at gmail.com>
 Standards-Version: 3.9.1
 Homepage: http://search.cpan.org/dist/ORLite/
@@ -21,9 +30,12 @@
 
 Package: liborlite-perl
 Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}, libdbd-sqlite3-perl (>= 1.27),
- libdbi-perl (>= 1.607), libfile-path-perl,
- libfile-remove-perl, libparams-util-perl (>= 0.33),
+Depends: ${misc:Depends}, ${perl:Depends},
+ libdbd-sqlite3-perl (>= 1.27),
+ libdbi-perl (>= 1.607),
+ libfile-path-perl,
+ libfile-remove-perl,
+ libparams-util-perl (>= 0.33),
  perl (>= 5.10.1) | libfile-temp-perl (>= 0.20)
 Suggests: libclass-xsaccessor-perl
 Description: lightweight SQLite-specific ORM

Modified: trunk/liborlite-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/copyright?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/debian/copyright (original)
+++ trunk/liborlite-perl/debian/copyright Fri Jan 21 15:23:21 2011
@@ -4,7 +4,7 @@
 Name: ORLite
 
 Files: *
-Copyright: 2008-2010, Adam Kennedy <adamk at cpan.org>
+Copyright: 2008-2011, Adam Kennedy <adamk at cpan.org>
 License: Artistic or GPL-1+
 
 Files: inc/Module/*
@@ -21,7 +21,7 @@
  2009, Jaldhar H. Vyas <jaldhar at debian.org>
  2009, Nathan Handler <nhandler at ubuntu.com>
  2009, Rene Mayorga <rmayorga at debian.org>
- 2010, Angel Abad <angelabad at gmail.com>
+ 2010-2011, Angel Abad <angelabad at gmail.com>
  2010, Ansgar Burchardt <ansgar at debian.org>
  2010, Franck Joncourt <franck at debian.org>
  2010, gregor herrmann <gregoa at debian.org>
@@ -40,5 +40,5 @@
  the Free Software Foundation; either version 1, or (at your option)
  any later version.
  .
- On Debian systems, the complete text of version 1 of the General
+ On Debian systems, the complete text of version 1 of the GNU General
  Public License can be found in `/usr/share/common-licenses/GPL-1'.

Added: trunk/liborlite-perl/debian/patches/fix_pod_spelling
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/patches/fix_pod_spelling?rev=67607&op=file
==============================================================================
--- trunk/liborlite-perl/debian/patches/fix_pod_spelling (added)
+++ trunk/liborlite-perl/debian/patches/fix_pod_spelling Fri Jan 21 15:23:21 2011
@@ -1,0 +1,16 @@
+Description: fix POD spelling errors
+Author: Angel Abad <angelabad at gmail.com>
+Origin: vendor
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=64986 
+
+--- a/lib/ORLite.pm
++++ b/lib/ORLite.pm
+@@ -1069,7 +1069,7 @@
+ overriding method difficult.
+ 
+ The C<shim> option will make ORLite generate all of it's methods into a
+-seperate C<Foo::TableName::Shim> class, and leave the main table class
++separate C<Foo::TableName::Shim> class, and leave the main table class
+ C<Foo::TableName> as a transparent subclass of the shim.
+ 
+ This allows you to alter the behaviour of a table class without having

Added: trunk/liborlite-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/debian/patches/series?rev=67607&op=file
==============================================================================
--- trunk/liborlite-perl/debian/patches/series (added)
+++ trunk/liborlite-perl/debian/patches/series Fri Jan 21 15:23:21 2011
@@ -1,0 +1,1 @@
+fix_pod_spelling

Modified: trunk/liborlite-perl/lib/ORLite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/lib/ORLite.pm?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/lib/ORLite.pm (original)
+++ trunk/liborlite-perl/lib/ORLite.pm Fri Jan 21 15:23:21 2011
@@ -14,7 +14,7 @@
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.47';
+	$VERSION = '1.48';
 }
 
 # Support for the 'prune' option
@@ -45,17 +45,25 @@
 	}
 
 	# Check params and apply defaults
-	my %params = ();
+	my %params = (
+		# Simple defaults here, complex defaults later
+		package    => scalar(caller),
+		create     => 0,
+		cleanup    => '',
+		array      => 0,
+		xsaccessor => 0,
+		shim       => 0,
+		tables     => 1,
+		views      => 0,
+		x_update   => 0,
+	);
 	if ( defined Params::Util::_STRING($_[1]) ) {
 		# Support the short form "use ORLite 'db.sqlite'"
-		%params = ( file => $_[1] );
+		$params{file} = $_[1];
 	} elsif ( Params::Util::_HASHLIKE($_[1]) ) {
-		%params = %{ $_[1] };
+		%params = ( %params, %{$_[1]} );
 	} else {
 		Carp::croak("Missing, empty or invalid params HASH");
-	}
-	unless ( defined $params{create} ) {
-		$params{create} = 0;
 	}
 	unless (
 		defined Params::Util::_STRING($params{file})
@@ -69,27 +77,6 @@
 	}
 	unless ( defined $params{readonly} ) {
 		$params{readonly} = $params{create} ? 0 : ! -w $params{file};
-	}
-	unless ( defined $params{cleanup} ) {
-		$params{cleanup} = '';
-	}
-	unless ( defined $params{array} ) {
-		$params{array} = 0;
-	}
-	unless ( defined $params{xsaccessor} ) {
-		$params{xsaccessor} = 0;
-	}
-	unless ( defined $params{tables} ) {
-		$params{tables} = 1;
-	}
-	unless ( defined $params{views} ) {
-		$params{views} = 0;
-	}
-	unless ( defined $params{x_update} ) {
-		$params{x_update} = 0;
-	}
-	unless ( defined $params{package} ) {
-		$params{package} = scalar caller;
 	}
 	unless ( Params::Util::_CLASS($params{package}) ) {
 		Carp::croak("Missing or invalid package class");
@@ -470,10 +457,27 @@
 				? '{}'
 				: '{ Slice => {} }';
 
-			# Generate the elements in all packages
+			# Generate the package header
+			if ( $params{shim} ) {
+				# Generate a shim-wrapper class
+				$code .= <<"END_PERL";
+package $table->{class};
+
+\@$table->{class}::ISA = '$table->{class}::Shim';
+
+package $table->{class}::Shim;
+
+END_PERL
+			} else {
+				# Plain vanilla package header
+				$code .= <<"END_PERL";
+package $table->{class};
+
+END_PERL
+			}
+
+			# Generate the common elements for all classes
 			$code .= <<"END_PERL";
-package $table->{class};
-
 sub base { '$pkg' }
 
 sub table { '$table->{name}' }
@@ -1030,7 +1034,7 @@
 
 =head2 cleanup
 
-When working with embedded SQLite database containing rapidly changing
+When working with embedded SQLite databases containing rapidly changing
 state data, it is important for database performance and general health
 to make sure you VACUUM or ANALYZE the database regularly.
 
@@ -1056,6 +1060,35 @@
 cleanup operation will be made pointless when C<prune> deletes the file.
 
 By default, the C<prune> option is set to false.
+
+=head2 shim
+
+In some situtations you may wish to make extensive changes to the behaviour
+of the classes and methods generated by ORLite. Under normal circumstances
+all code is generated into the table class directly, which can make
+overriding method difficult.
+
+The C<shim> option will make ORLite generate all of it's methods into a
+seperate C<Foo::TableName::Shim> class, and leave the main table class
+C<Foo::TableName> as a transparent subclass of the shim.
+
+This allows you to alter the behaviour of a table class without having
+to do nasty tricks with symbol tables in order to alter or replace methods.
+
+  package My::Person;
+  
+  # Write a log message when we create a new object
+  sub create {
+      my $class = shift;
+      my $self  = SUPER::create(@_);
+      my $name  = $self->name;
+      print LOG "Created new person '$name'\n";
+      return $self;
+  }
+
+The C<shim> option is global. It will alter the structure of all table
+classes at once. However, unless you are making alterations to a class
+the impact of this different class structure should be zero.
 
 =head1 ROOT PACKAGE METHODS
 
@@ -1602,11 +1635,11 @@
 
 =head1 SEE ALSO
 
-L<ORLite::Mirror>, L<ORLite::Migrate>
+L<ORLite::Mirror>, L<ORLite::Migrate>, L<ORLite::Pod>
 
 =head1 COPYRIGHT
 
-Copyright 2008 - 2010 Adam Kennedy.
+Copyright 2008 - 2011 Adam Kennedy.
 
 This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.

Modified: trunk/liborlite-perl/t/08_prune.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/08_prune.pl?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/t/08_prune.pl (original)
+++ trunk/liborlite-perl/t/08_prune.pl Fri Jan 21 15:23:21 2011
@@ -4,7 +4,7 @@
 
 use strict;
 
-our $VERSION = '1.47';
+our $VERSION = '1.48';
 
 unless ( $ORLite::VERSION eq $VERSION ) {
 	die('Failed to load correct ORLite version');

Modified: trunk/liborlite-perl/t/17_cache.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/17_cache.t?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/t/17_cache.t (original)
+++ trunk/liborlite-perl/t/17_cache.t Fri Jan 21 15:23:21 2011
@@ -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-47-user_version-2.pm } );
+my $cached = catfile( qw{ t Foo-Bar-1-23-ORLite-1-48-user_version-2.pm } );
 clear($cached);
 ok( ! -e $cached, 'Cache file does not initially exist' );
 

Modified: trunk/liborlite-perl/t/lib/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liborlite-perl/t/lib/Test.pm?rev=67607&op=diff
==============================================================================
--- trunk/liborlite-perl/t/lib/Test.pm (original)
+++ trunk/liborlite-perl/t/lib/Test.pm Fri Jan 21 15:23:21 2011
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA @EXPORT};
 BEGIN {
-	$VERSION = '1.47';
+	$VERSION = '1.48';
 	@ISA     = 'Exporter';
 	@EXPORT  = qw{ test_db connect_ok create_ok };
 }




More information about the Pkg-perl-cvs-commits mailing list