r8067 - in /trunk/libbusiness-isbn-perl: Changes MANIFEST META.yml Makefile.PL bad-isbn13s.txt debian/changelog isbn13s.txt lib/ISBN.pm lib/ISBN13.pm t/isbn10.t t/isbn13.t t/pod_coverage.t t/rt/29089.t t/rt/29292.t t/test_manifest t/valid_isbn_checksum.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Thu Oct 4 16:03:06 UTC 2007
Author: gregoa-guest
Date: Thu Oct 4 16:03:06 2007
New Revision: 8067
URL: http://svn.debian.org/wsvn/?sc=1&rev=8067
Log:
New upstream release.
Added:
trunk/libbusiness-isbn-perl/bad-isbn13s.txt
- copied unchanged from r8066, branches/upstream/libbusiness-isbn-perl/current/bad-isbn13s.txt
trunk/libbusiness-isbn-perl/isbn13s.txt
- copied unchanged from r8066, branches/upstream/libbusiness-isbn-perl/current/isbn13s.txt
trunk/libbusiness-isbn-perl/t/rt/29089.t
- copied unchanged from r8066, branches/upstream/libbusiness-isbn-perl/current/t/rt/29089.t
trunk/libbusiness-isbn-perl/t/rt/29292.t
- copied unchanged from r8066, branches/upstream/libbusiness-isbn-perl/current/t/rt/29292.t
trunk/libbusiness-isbn-perl/t/valid_isbn_checksum.t
- copied unchanged from r8066, branches/upstream/libbusiness-isbn-perl/current/t/valid_isbn_checksum.t
Modified:
trunk/libbusiness-isbn-perl/Changes
trunk/libbusiness-isbn-perl/MANIFEST
trunk/libbusiness-isbn-perl/META.yml
trunk/libbusiness-isbn-perl/Makefile.PL
trunk/libbusiness-isbn-perl/debian/changelog
trunk/libbusiness-isbn-perl/lib/ISBN.pm
trunk/libbusiness-isbn-perl/lib/ISBN13.pm
trunk/libbusiness-isbn-perl/t/isbn10.t
trunk/libbusiness-isbn-perl/t/isbn13.t
trunk/libbusiness-isbn-perl/t/pod_coverage.t
trunk/libbusiness-isbn-perl/t/test_manifest
Modified: trunk/libbusiness-isbn-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/Changes?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/Changes (original)
+++ trunk/libbusiness-isbn-perl/Changes Thu Oct 4 16:03:06 2007
@@ -1,6 +1,36 @@
Revision history for Perl extension Business::ISBN.
-$Revision: 2.4 $
-$Id: Changes,v 2.4 2007/08/15 08:38:28 comdog Exp $
+$Revision: 2.12 $
+$Id: Changes,v 2.12 2007/10/02 08:17:39 comdog Exp $
+
+2.03 - Tue Oct 2 03:17:34 2007
+ * Fixed minor distro problems and bumped to release version 2.03
+
+2.02_05 - Wed Sep 12 13:27:09 2007
+ * Explore RT #29292. I don't seem to have the problem with
+ hyphens for ISBN-13, but let's see what CPAN Testers has to
+ say
+
+2.02_04 - Sat Sep 1 14:55:00 2007
+ [BUGFIX] ISBN13 was returing "Bookland" for all groups, but
+ it shouldn't do that. Now it returns the same thing you'd
+ get from ISBN10 (e.g. "English", "German", ... ).
+
+2.02_03 - Sat Sep 1 04:12:49 2007
+ [BUGFIX] RT 29089 - I had the wrong _max_length for ISBN13. That 13
+ is the hint that it should be 13. :)
+
+2.02_02 - Sat Aug 25 05:57:22 2007
+ [FEATURE] added exportable function valid_isbn_checksum that
+ takes care of all of the object stuff for you and just gives
+ you the answer. In previous docs, this was called is_valid_checksum
+ even though that conflicted with an object method. It was
+ documented but never implemented. Now it's there. :)
+ [BUGFIX] now should pass tests under 5.6.2, after a bit of
+ backporting. Upgrade already people! :)
+
+2.02_01 - Fri Aug 17 14:00:51 2007
+ * Don't import import() from Exporter. There are a lot of people
+ (apparently) using very old perls, not just CPAN Testers.
2.02 - Wed Aug 15 03:11:25 2007
* fixes RT #28843: an ISBN-13 with a bad prefix shouldn't croak,
@@ -15,7 +45,7 @@
not so bad, but test it before you rip out the old Business::ISBN
stuff.
-2.00 - Wed Mar 14 00:38:18 2007
+2.00_01 - Wed Mar 14 00:38:18 2007
* DEVELOPER RELEASE
* Completely redone internals to handle ISBN-10 and ISBN-13
* Some interface changes to Business::ISBN 1.x
@@ -39,37 +69,37 @@
it found
1.79 - Tue Dec 14 05:00:37 2004
-* Updated tests for new ISBN data: previously invalid ISBNs are now
-valid. The latest data is in Business::ISBN::Data 1.09 and is current
-as of November 2004.
-* You don't need this version of Business::ISBN if you already have it,
-although you should get the latest Business::ISBN::Data.
+ * Updated tests for new ISBN data: previously invalid ISBNs are now
+ valid. The latest data is in Business::ISBN::Data 1.09 and is current
+ as of November 2004.
+ * You don't need this version of Business::ISBN if you already have it,
+ although you should get the latest Business::ISBN::Data.
1.78 - Sun Nov 21 19:46:40 2004
-* Require the latest version on Business::ISBN::Data, which was unbundled in
-the last version. You need Business::ISBN::Data 1.08 to pass the latest
-tests that check for the new ranges the ISBN folks assigned a couple of
-years ago.
+ * Require the latest version on Business::ISBN::Data, which was
+ unbundled in the last version. You need Business::ISBN::Data 1.08
+ to pass the latest tests that check for the new ranges the ISBN
+ folks assigned a couple of years ago.
1.77 - Wed Oct 27 02:39:17 2004
-* removed Business::ISBN::Data, which is now a separate module so you
-can update the data without updating the rest of the stuff. Previously,
-CPAN.pm would install Business::ISBN::Data as a prerequisite, and this
-distribution would come along and overwrite it with old data. That
-was a bad thing.
+ * removed Business::ISBN::Data, which is now a separate module so
+ you can update the data without updating the rest of the stuff.
+ Previously, CPAN.pm would install Business::ISBN::Data as a
+ prerequisite, and this distribution would come along and overwrite
+ it with old data. That was a bad thing.
1.76 - Fri Oct 8 16:12:51 2004
-* somehow this module went missing from CPAN, so here it is again
-* no need to upgrade if you have the previous version
+ * somehow this module went missing from CPAN, so here it is again
+ * no need to upgrade if you have the previous version
1.74 - Thu Sep 2 17:17:20 2004
-* another distro fix: some documentation cleanups, and the README is
-now in MANIFEST. You do not need to upgrade if you already have
-installed this module.
+ * another distro fix: some documentation cleanups, and the README
+ is now in MANIFEST. You do not need to upgrade if you already
+ have installed this module.
1.73 - Thu Sep 2 16:21:10 2004
-* this is a distro fix only. if you already have Business::ISBN, you
-don't need this
+ * this is a distro fix only. if you already have Business::ISBN,
+ you don't need this
1.72 - Wed Feb 11 16:18:30 2004
* removed errant File::Find::Rule use
Modified: trunk/libbusiness-isbn-perl/MANIFEST
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/MANIFEST?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/MANIFEST (original)
+++ trunk/libbusiness-isbn-perl/MANIFEST Thu Oct 4 16:03:06 2007
@@ -1,6 +1,8 @@
+bad-isbn13s.txt
bad-isbns.txt
Changes
examples/README
+isbn13s.txt
isbns.txt
lib/ISBN.pm
lib/ISBN10.pm
@@ -22,5 +24,8 @@
t/pod_coverage.t
t/rt/27107.t
t/rt/28843.t
+t/rt/29089.t
+t/rt/29292.t
t/test_manifest
+t/valid_isbn_checksum.t
t/xisbn10.t
Modified: trunk/libbusiness-isbn-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/META.yml?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/META.yml (original)
+++ trunk/libbusiness-isbn-perl/META.yml Thu Oct 4 16:03:06 2007
@@ -1,15 +1,15 @@
--- #YAML:1.0
name: Business-ISBN
-version: 2.02
-abstract: ~
+version: 2.03
+abstract: Parse and validate ISBNs
license: perl
generated_by: ExtUtils::MakeMaker version 6.32
distribution_type: module
requires:
- Business::ISBN::Data: 1.09
+ Business::ISBN::Data: 1.15
Test::More: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
author:
- brian d foy <bdfoy at cpan.org>
Modified: trunk/libbusiness-isbn-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/Makefile.PL?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/Makefile.PL (original)
+++ trunk/libbusiness-isbn-perl/Makefile.PL Thu Oct 4 16:03:06 2007
@@ -1,17 +1,18 @@
-# $Id: Makefile.PL,v 2.2 2007/03/14 07:37:38 comdog Exp $
+# $Id: Makefile.PL,v 2.4 2007/10/02 08:13:37 comdog Exp $
use ExtUtils::MakeMaker;
eval "use Test::Manifest 1.14";
WriteMakefile(
'NAME' => 'Business::ISBN',
+ 'ABSTRACT' => 'Parse and validate ISBNs',
'VERSION_FROM' => 'lib/ISBN.pm',
'LICENSE' => 'perl',
'AUTHOR' => 'brian d foy <bdfoy at cpan.org>',
'PREREQ_PM' => {
'Test::More' => '0',
- 'Business::ISBN::Data' => '1.09',
+ 'Business::ISBN::Data' => '1.15',
},
'PM' => {
Modified: trunk/libbusiness-isbn-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/debian/changelog?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/debian/changelog (original)
+++ trunk/libbusiness-isbn-perl/debian/changelog Thu Oct 4 16:03:06 2007
@@ -1,3 +1,9 @@
+libbusiness-isbn-perl (2.03-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at> Thu, 04 Oct 2007 18:02:54 +0200
+
libbusiness-isbn-perl (2.02-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libbusiness-isbn-perl/lib/ISBN.pm
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/lib/ISBN.pm?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/lib/ISBN.pm (original)
+++ trunk/libbusiness-isbn-perl/lib/ISBN.pm Thu Oct 4 16:03:06 2007
@@ -1,5 +1,5 @@
-# $Revision: 2.6 $
-# $Id: ISBN.pm,v 2.6 2007/08/15 08:06:49 comdog Exp $
+# $Revision: 2.14 $
+# $Id: ISBN.pm,v 2.14 2007/10/02 08:13:37 comdog Exp $
package Business::ISBN;
use strict;
@@ -68,9 +68,9 @@
$MAX_GROUP_CODE_LENGTH %ERROR_TEXT );
use Carp qw(carp croak cluck);
-use Exporter qw( import );
-
-use Business::ISBN::Data 1.09; # now a separate module
+use base qw(Exporter);
+
+use Business::ISBN::Data 1.15; # now a separate module
# ugh, hack
*group_data = *Business::ISBN::country_data;
sub _group_data { $group_data{ $_[1] } }
@@ -99,14 +99,16 @@
INVALID_GROUP_CODE INVALID_PUBLISHER_CODE
BAD_CHECKSUM GOOD_ISBN BAD_ISBN
INVALID_PREFIX
- %ERROR_TEXT);
+ %ERROR_TEXT
+ valid_isbn_checksum
+ );
%EXPORT_TAGS = (
'all' => \@EXPORT_OK,
);
};
-$VERSION = "2.02";
+$VERSION = "2.03";
sub INVALID_PREFIX () { -4 };
sub INVALID_GROUP_CODE () { -2 };
@@ -128,6 +130,40 @@
use Business::ISBN10;
use Business::ISBN13;
+=head2 Function interface
+
+=over 4
+
+=item valid_isbn_checksum( ISBN10 | ISBN13 )
+
+This function is exportable on demand, and works for either 10
+or 13 character ISBNs).
+
+ use Business::ISBN qw( valid_isbn_checksum );
+
+Returns 1 if the ISBN is a valid ISBN with the right checksum.
+
+Returns 0 if the ISBN has valid prefix and publisher codes, but an
+invalid checksum.
+
+Returns undef if the ISBN does not validate for any other reason.
+
+=back
+
+=cut
+
+sub valid_isbn_checksum
+ {
+ my $isbn = shift;
+
+ my $obj = Business::ISBN->new( $isbn );
+
+ return 1 if $obj->is_valid_checksum == GOOD_ISBN;
+ return 0 if $obj->is_valid_checksum == BAD_CHECKSUM;
+ return;
+ }
+
+=head2 Object interface
=over 4
@@ -173,7 +209,7 @@
with C<is_valid()> rather than relying on the return value
of the constructor. If all one wants to do is check the
validity of an ISBN, one can skip the object-oriented
-interface and use the C<is_valid_checksum()> function
+interface and use the C<valid_isbn_checksum()> function
which is exportable on demand.
If the constructor decides it cannot create an object, it
@@ -417,7 +453,7 @@
to use the least three positions specified. If you pass
an anonymous array of several positions, the list will
be sorted and the lowest three positions will be used.
-Positions less than 1 and greater than 9 are silently
+Positions less than 1 and greater than 12 are silently
ignored.
A terminating 'x' is changed to 'X'.
Modified: trunk/libbusiness-isbn-perl/lib/ISBN13.pm
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/lib/ISBN13.pm?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/lib/ISBN13.pm (original)
+++ trunk/libbusiness-isbn-perl/lib/ISBN13.pm Thu Oct 4 16:03:06 2007
@@ -1,5 +1,5 @@
-# $Revision: 2.5 $
-# $Id: ISBN13.pm,v 2.5 2007/08/15 08:04:56 comdog Exp $
+# $Revision: 2.8 $
+# $Id: ISBN13.pm,v 2.8 2007/09/17 02:34:58 comdog Exp $
package Business::ISBN13;
use strict;
use base qw(Business::ISBN);
@@ -24,15 +24,16 @@
my $debug = 0;
-($VERSION) = q$Revision: 2.5 $ =~ m/(\d+\.\d+)\s*$/;
+($VERSION) = q$Revision: 2.8 $ =~ m/(\d+\.\d+)\s*$/;
-sub _max_length { 10 }
+sub _max_length { 13 }
sub _set_type { $_[0]->{type} = 'ISBN13' }
sub _parse_prefix
{
- ( $_[0]->isbn =~ /\A(97[89])(.{10})\z/g )[0];
+ my $isbn = $_[0]->isbn; # stupid workaround for 'Can't modify non-lvalue subroutine call'
+ ( $isbn =~ /\A(97[89])(.{10})\z/g )[0];
}
sub _set_prefix
@@ -53,7 +54,7 @@
]
}
-sub group { 'Bookland' }
+# sub group { 'Bookland' }
sub as_isbn10
{
Modified: trunk/libbusiness-isbn-perl/t/isbn10.t
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/t/isbn10.t?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/t/isbn10.t (original)
+++ trunk/libbusiness-isbn-perl/t/isbn10.t Thu Oct 4 16:03:06 2007
@@ -1,4 +1,4 @@
-# $Revision: 2.4 $
+# $Revision: 2.6 $
use strict;
use Test::More 'no_plan';
@@ -13,7 +13,6 @@
my $GOOD_EAN_STRING = "978-0-596-52724-2";
my $GROUP = "English";
-my $BOOKLAND = "Bookland";
my $PREFIX = '978';
@@ -77,7 +76,7 @@
is( $clone->prefix, $PREFIX, "$GOOD_ISBN has right prefix");
is( $clone->publisher_code, $PUBLISHER, "$GOOD_ISBN has right publisher");
is( $clone->group_code, $GROUP_CODE, "$GOOD_ISBN has right country code");
-is( $clone->group, $BOOKLAND, "$GOOD_ISBN has right country");
+is( $clone->group, $GROUP, "$GOOD_ISBN has right country");
is( $clone->as_string, $GOOD_EAN_STRING, "$GOOD_ISBN stringifies correctly");
is( $clone->as_string([]), $GOOD_EAN, "$GOOD_ISBN stringifies correctly");
}
@@ -128,7 +127,7 @@
open FILE, $file or
skip( "Could not read $file: $!", 1, "Need $file");
- print STDERR "\nChecking ISBNs... (this may take a bit)\n";
+ diag "\nChecking ISBNs... (this may take a bit)";
my $bad = 0;
while( <FILE> )
@@ -140,7 +139,7 @@
my $text = $Business::ISBN::ERROR_TEXT{ $result };
$bad++ unless $result eq Business::ISBN::GOOD_ISBN;
- print STDERR "$_ is not valid? [ $result -> $text ]\n"
+ diag "\n\t$_ is not valid? [ $result -> $text ]"
unless $result eq Business::ISBN::GOOD_ISBN;
}
@@ -158,7 +157,7 @@
open FILE, $file or
skip( "Could not read $file: $!", 1, "Need $file");
- print STDERR "\nChecking bad ISBNs... (this should be fast)\n";
+ diag "\nChecking bad ISBNs... (this should be fast)";
my $good = 0;
my @good = ();
@@ -179,7 +178,7 @@
{
local $" = "\n\t";
ok( $good == 0, "Don't match bad ISBNs" ) ||
- diag( "Matched $good bad ISBNs\n\t at good\n" );
+ diag( "\nMatched $good bad ISBNs\n\t at good" );
}
}
Modified: trunk/libbusiness-isbn-perl/t/isbn13.t
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/t/isbn13.t?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/t/isbn13.t (original)
+++ trunk/libbusiness-isbn-perl/t/isbn13.t Thu Oct 4 16:03:06 2007
@@ -1,4 +1,4 @@
-# $Revision: 2.2 $
+# $Revision: 2.4 $
use strict;
use Test::More 'no_plan';
@@ -15,7 +15,6 @@
my $GROUP = "English";
my $GROUP_CODE = "0";
-my $BOOKLAND = 'Bookland';
my $PUBLISHER = "596";
@@ -50,7 +49,7 @@
is( $isbn->prefix, $PREFIX, "$GOOD_ISBN has right prefix");
is( $isbn->group_code, $GROUP_CODE, "$GOOD_ISBN has right group code");
-is( $isbn->group, $BOOKLAND, "$GOOD_ISBN has right group");
+is( $isbn->group, $GROUP, "$GOOD_ISBN has right group");
is( $isbn->publisher_code, $PUBLISHER, "$GOOD_ISBN has right publisher");
@@ -73,7 +72,7 @@
is( $isbn->prefix, $PREFIX, "$GOOD_ISBN has right prefix");
is( $isbn->group_code, $GROUP_CODE, "$GOOD_ISBN has right group code");
-is( $isbn->group, $BOOKLAND, "$GOOD_ISBN has right group");
+is( $isbn->group, $GROUP, "$GOOD_ISBN has right group");
is( $isbn->publisher_code, $PUBLISHER, "$GOOD_ISBN has right publisher");
@@ -193,7 +192,7 @@
open FILE, $file or
skip( "Could not read $file: $!", 1, "Need $file");
- print STDERR "\nChecking ISBNs... (this may take a bit)\n";
+ diag "\nChecking ISBN13s... (this may take a bit)";
my $bad = 0;
while( <FILE> )
@@ -205,7 +204,7 @@
my $text = $Business::ISBN::ERROR_TEXT{ $result };
$bad++ unless $result eq Business::ISBN::GOOD_ISBN;
- print STDERR "$_ is not valid? [ $result -> $text ]\n"
+ diag "\n\t$_ is not valid? [ $result -> $text ]\n"
unless $result eq Business::ISBN::GOOD_ISBN;
}
@@ -222,7 +221,7 @@
open FILE, $file or
skip( "Could not read $file: $!", 1, "Need $file");
- print STDERR "\nChecking bad ISBNs... (this should be fast)\n";
+ diag "\nChecking bad ISBN13s... (this should be fast)";
my $good = 0;
my @good = ();
Modified: trunk/libbusiness-isbn-perl/t/pod_coverage.t
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/t/pod_coverage.t?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/t/pod_coverage.t (original)
+++ trunk/libbusiness-isbn-perl/t/pod_coverage.t Thu Oct 4 16:03:06 2007
@@ -1,19 +1,5 @@
# : pod_coverage.t,v 1.1 2005/03/04 13:08:26 comdog Exp
-use Test::More;
+use Test::More tests => 1;
eval "use Test::Pod::Coverage";
-
-if( $@ )
- {
- plan skip_all => "Test::Pod::Coverage required for testing POD";
- }
-else
- {
- plan tests => 1;
-
- pod_coverage_ok( "Business::ISBN",
- {
- trustme => [ qr/^[A-Z_]+$/ ],
- }
- );
- }
+pass();
Modified: trunk/libbusiness-isbn-perl/t/test_manifest
URL: http://svn.debian.org/wsvn/trunk/libbusiness-isbn-perl/t/test_manifest?rev=8067&op=diff
==============================================================================
--- trunk/libbusiness-isbn-perl/t/test_manifest (original)
+++ trunk/libbusiness-isbn-perl/t/test_manifest Thu Oct 4 16:03:06 2007
@@ -1,4 +1,4 @@
-# $Id: test_manifest,v 2.5 2007/08/15 08:04:56 comdog Exp $
+# $Id: test_manifest,v 2.8 2007/09/10 23:45:49 comdog Exp $
load.t
pod.t
pod_coverage.t
@@ -7,7 +7,10 @@
albania.t
isbn10.t
isbn13.t
+valid_isbn_checksum.t
xisbn10.t
png_barcode.t
rt/27107.t
-rt/28843.t
+rt/28843.t
+rt/29089.t
+rt/29292.t
More information about the Pkg-perl-cvs-commits
mailing list