Hello community,

here is the log from the commit of package perl-Business-ISBN for 
openSUSE:Factory checked in at 2014-09-25 08:42:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Business-ISBN (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Business-ISBN.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Business-ISBN"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Business-ISBN/perl-Business-ISBN.changes    
2014-01-07 14:44:05.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Business-ISBN.new/perl-Business-ISBN.changes   
    2014-09-25 08:42:50.000000000 +0200
@@ -1,0 +2,11 @@
+Sun Sep 21 13:44:22 UTC 2014 - l...@linux-schulserver.de
+
+- update to 2.09:
+  * Break circular dependency on Test::ISBN
+  * Add increment and decrement to create new article numbers
+    (Markus Spann)
+- require Business::ISBN::Data >= 20140910
+- also build require perl(GD) and perl(GD::Barcode::EAN13) for 
+  Barcode testing
+
+-------------------------------------------------------------------

Old:
----
  Business-ISBN-2.07.tar.gz

New:
----
  Business-ISBN-2.09.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Business-ISBN.spec ++++++
--- /var/tmp/diff_new_pack.ByrDuD/_old  2014-09-25 08:42:51.000000000 +0200
+++ /var/tmp/diff_new_pack.ByrDuD/_new  2014-09-25 08:42:51.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Business-ISBN
-Version:        2.07
+Version:        2.09
 Release:        0
 %define         cpan_name Business-ISBN
 Summary:        Work with International Standard Book Numbers
@@ -29,14 +29,12 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(Business::ISBN::Data) >= 20081208
+BuildRequires:  perl(Business::ISBN::Data) >= 20140910
+BuildRequires:  perl(GD)
+BuildRequires:  perl(GD::Barcode::EAN13)
 BuildRequires:  perl(URI)
-#BuildRequires: perl(Business::ISBN)
-#BuildRequires: perl(Business::ISBN10)
-#BuildRequires: perl(Business::ISBN13)
-#BuildRequires: perl(GD::Barcode::EAN13)
-#BuildRequires: perl(LWP::Simple)
-Requires:       perl(Business::ISBN::Data) >= 20081208
+#BuildRequires:  perl(Test::Pod)
+Requires:       perl(Business::ISBN::Data) >= 20140910
 Requires:       perl(URI)
 %{perl_requires}
 

++++++ Business-ISBN-2.07.tar.gz -> Business-ISBN-2.09.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/Changes 
new/Business-ISBN-2.09/Changes
--- old/Business-ISBN-2.07/Changes      2014-01-03 20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/Changes      2014-09-21 00:16:00.000000000 +0200
@@ -1,5 +1,12 @@
 Revision history for Perl extension Business::ISBN.
 
+2.09 - Sat Sep 20 18:15:37 2014
+       * Break circular dependency on Test::ISBN
+
+2.08 - Fri Sep 19 12:53:21 2014
+       * Add increment and decrement to create new article numbers
+       (Markus Spann)
+
 2.07 - Fri Jan  3 14:20:04 2014
        * Get rid of MYMETA
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/MANIFEST 
new/Business-ISBN-2.09/MANIFEST
--- old/Business-ISBN-2.07/MANIFEST     2014-01-03 20:20:22.000000000 +0100
+++ new/Business-ISBN-2.09/MANIFEST     2014-09-21 00:16:01.000000000 +0200
@@ -27,6 +27,7 @@
 t/rt/28843.t
 t/rt/29089.t
 t/rt/29292.t
+t/step.t
 t/test_manifest
 t/valid_isbn_checksum.t
 t/xisbn10.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/META.json 
new/Business-ISBN-2.09/META.json
--- old/Business-ISBN-2.07/META.json    2014-01-03 20:20:22.000000000 +0100
+++ new/Business-ISBN-2.09/META.json    2014-09-21 00:16:01.000000000 +0200
@@ -4,7 +4,7 @@
       "brian d foy <bd...@cpan.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter 
version 2.112150",
+   "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter 
version 2.120921",
    "license" : [
       "perl_5"
    ],
@@ -22,22 +22,33 @@
    "prereqs" : {
       "build" : {
          "requires" : {
-            "ExtUtils::MakeMaker" : 0
+            "ExtUtils::MakeMaker" : "0"
          }
       },
       "configure" : {
          "requires" : {
-            "ExtUtils::MakeMaker" : 0
+            "ExtUtils::MakeMaker" : "0"
          }
       },
       "runtime" : {
          "requires" : {
-            "Business::ISBN::Data" : "20081208",
-            "Test::More" : 0,
-            "URI" : 0
+            "Business::ISBN::Data" : "20140910",
+            "URI" : "0"
+         }
+      },
+      "test" : {
+         "requires" : {
+            "Test::More" : "0.95"
          }
       }
    },
    "release_status" : "stable",
-   "version" : "2.07"
+   "resources" : {
+      "repository" : {
+         "type" : "git",
+         "url" : "https://github.com/briandfoy/business--isbn.git";,
+         "web" : "https://github.com/briandfoy/business--isbn";
+      }
+   },
+   "version" : "2.09"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/META.yml 
new/Business-ISBN-2.09/META.yml
--- old/Business-ISBN-2.07/META.yml     2014-01-03 20:20:22.000000000 +0100
+++ new/Business-ISBN-2.09/META.yml     2014-09-21 00:16:01.000000000 +0200
@@ -4,10 +4,11 @@
   - 'brian d foy <bd...@cpan.org>'
 build_requires:
   ExtUtils::MakeMaker: 0
+  Test::More: 0.95
 configure_requires:
   ExtUtils::MakeMaker: 0
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 
2.112150'
+generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 
2.120921'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -18,7 +19,8 @@
     - t
     - inc
 requires:
-  Business::ISBN::Data: 20081208
-  Test::More: 0
+  Business::ISBN::Data: 20140910
   URI: 0
-version: 2.07
+resources:
+  repository: https://github.com/briandfoy/business--isbn.git
+version: 2.09
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/Makefile.PL 
new/Business-ISBN-2.09/Makefile.PL
--- old/Business-ISBN-2.07/Makefile.PL  2014-01-03 20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/Makefile.PL  2014-09-21 00:16:00.000000000 +0200
@@ -1,6 +1,6 @@
 require 5.008;
 
-use ExtUtils::MakeMaker;
+use ExtUtils::MakeMaker 6.65;
 
 eval "use Test::Manifest 1.21";
        
@@ -12,10 +12,24 @@
        'AUTHOR'        => 'brian d foy <bd...@cpan.org>',
 
        'PREREQ_PM'     => {
-               'Test::More'           => '0',
-               'Business::ISBN::Data' => '20081208',
+               'Business::ISBN::Data' => '20140910',
                'URI'                  => '0',
                },
 
+       'TEST_REQUIRES' => {
+               'Test::More'  => '0.95',
+               },
+
+       'META_MERGE' => {
+               'meta-spec' => { version => 2 },
+                       resources => {
+                               repository => {
+                                       type => 'git',
+                                       url  => 
'https://github.com/briandfoy/business--isbn.git',
+                                       web  => 
'https://github.com/briandfoy/business--isbn',
+                               },
+                       },
+               },
+
        clean => { FILES => '*.bak Business-*' },
        );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/lib/Business/ISBN.pm 
new/Business-ISBN-2.09/lib/Business/ISBN.pm
--- old/Business-ISBN-2.07/lib/Business/ISBN.pm 2014-01-03 20:20:21.000000000 
+0100
+++ new/Business-ISBN-2.09/lib/Business/ISBN.pm 2014-09-21 00:16:00.000000000 
+0200
@@ -65,6 +65,7 @@
        BAD_CHECKSUM
        GOOD_ISBN
        BAD_ISBN
+       ARTICLE_CODE_OUT_OF_RANGE
        );
 use vars qw( $VERSION @ISA @EXPORT_OK %EXPORT_TAGS $debug %group_data
        $MAX_GROUP_CODE_LENGTH %ERROR_TEXT );
@@ -72,7 +73,7 @@
 use Carp qw(carp croak cluck);
 use base qw(Exporter);
 
-use Business::ISBN::Data 20120719.001; # now a separate module
+use Business::ISBN::Data 20140910.001; # now a separate module
 # ugh, hack
 *group_data = *Business::ISBN::country_data;
 sub _group_data { $group_data{ $_[1] } }
@@ -98,7 +99,7 @@
 BEGIN {
        @EXPORT_OK = qw(
                INVALID_GROUP_CODE INVALID_PUBLISHER_CODE
-               BAD_CHECKSUM GOOD_ISBN BAD_ISBN
+               BAD_CHECKSUM GOOD_ISBN BAD_ISBN ARTICLE_CODE_OUT_OF_RANGE
                INVALID_PREFIX
                %ERROR_TEXT
                valid_isbn_checksum
@@ -109,15 +110,15 @@
                );
        };
 
-$VERSION = "2.07";
-
-sub INVALID_PREFIX         () { -4 };
-sub INVALID_GROUP_CODE     () { -2 };
-sub INVALID_PUBLISHER_CODE () { -3 };
-sub BAD_CHECKSUM           () { -1 };
-sub GOOD_ISBN              () {  1 };
-sub BAD_ISBN               () {  0 };
+$VERSION = "2.09";
 
+sub ARTICLE_CODE_OUT_OF_RANGE () { -5 }
+sub INVALID_PREFIX            () { -4 };
+sub INVALID_GROUP_CODE        () { -2 };
+sub INVALID_PUBLISHER_CODE    () { -3 };
+sub BAD_CHECKSUM              () { -1 };
+sub GOOD_ISBN                 () {  1 };
+sub BAD_ISBN                  () {  0 };
 
 %ERROR_TEXT = (
         0 => "Bad ISBN",
@@ -126,6 +127,7 @@
        -2 => "Invalid group code",
        -3 => "Invalid publisher code",
        -4 => "Invalid prefix (must be 978 or 979)",
+       -5 => "Incremented article code would be out of range",
        );
 
 use Business::ISBN10;
@@ -373,6 +375,30 @@
 
 sub article_code { $_[0]->{'article_code'} }
 
+=item article_code_length
+
+Returns the article code length for the ISBN.
+
+=cut
+
+sub article_code_length { length $_[0]->{'article_code'} }
+
+=item article_code_min
+
+Returns the minimum article code length for the publisher code.
+
+=cut
+
+sub article_code_min { 0 }
+
+=item article_code_max
+
+Returns the max article code length for the publisher code.
+
+=cut
+
+sub article_code_max { '9' x $_[0]->article_code_length }
+
 =item checksum
 
 Returns the checksum code for the ISBN. This checksum may not be valid since
@@ -428,7 +454,7 @@
        }
 
 
-=item as_string(),  as_string([])
+=item as_string(), as_string([])
 
 Return the ISBN as a string.  This function takes an
 optional anonymous array (or array reference) that specifies
@@ -538,6 +564,72 @@
        return "http://xisbn.worldcat.org/xid/isbn/$isbn";;
        }
 
+=item increment
+
+Returns the next C<Business::ISBN> by incrementing the article code of
+the specified ISBN (object or scalar).
+
+Returns undef, if the parameter is invalid or equals the maximum
+possible ISBN for the publisher.
+
+       $isbn = Business::ISBN->new('1565922573');  # 1-56592-257-3
+       $next_isbn = $isbn->increment;              # 1-56592-258-1
+
+If the next article code would exceed the maximum possible article
+code (such as incrementing 999 to 1000), this returns ARTICLE_CODE_OUT_OF_RANGE
+as the error.
+
+=cut
+
+sub increment { $_[0]->_step_article_code( +1 ) }
+
+=item decrement
+
+Returns the previous C<Business::ISBN> by decrementing the article
+code of the specified ISBN (object or scalar).
+
+Returns undef, if the parameter is invalid or equals the minimum
+possible ISBN for the publisher.
+
+       $isbn = Business::ISBN->new('1565922573');  # 1-56592-257-3
+       $prev_isbn = $isbn->decrement;              # 1-56592-256-5
+
+If the next article code would exceed the maximum possible article
+code (such as incrementing 000 to -1), this returns ARTICLE_CODE_OUT_OF_RANGE
+as the error.
+
+=cut
+
+sub decrement { $_[0]->_step_article_code( -1 ) }
+
+sub _step_article_code {
+       my( $self, $step ) = @_;
+       carp "The step for _step_isbn must be an integer"
+               unless( $step == int $step and $step != 0 );
+
+       my $next_article_code = int $self->article_code + $step;
+
+       return ARTICLE_CODE_OUT_OF_RANGE unless
+               $next_article_code >= $self->article_code_min
+                       &&
+               $next_article_code <= $self->article_code_max
+               ;
+
+       my $next_isbn = Business::ISBN->new(
+               join('', 
+                       $self->prefix, 
+                       $self->group_code, 
+                       $self->publisher_code, 
+                       sprintf( "%0*d", $self->article_code_length, 
$next_article_code ), 
+                       '0'
+                       )
+               );
+
+       $next_isbn->fix_checksum;
+
+       $next_isbn;
+       }
+
 =item png_barcode
 
 Returns image data in PNG format for the barcode for the ISBN. This
@@ -808,4 +900,6 @@
 Ed Summers C<< <esumm...@cpan.org> >> has volunteered to help with
 this module.
 
+Markus Spann C<< <markus_sp...@gmx.de> >> added C<increment> and C<decrement>.
+
 =cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/lib/Business/ISBN10.pm 
new/Business-ISBN-2.09/lib/Business/ISBN10.pm
--- old/Business-ISBN-2.07/lib/Business/ISBN10.pm       2014-01-03 
20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/lib/Business/ISBN10.pm       2014-09-21 
00:16:00.000000000 +0200
@@ -24,7 +24,7 @@
 
 my $debug = 0;
 
-$VERSION   = '2.07';
+$VERSION   = '2.09';
 
 sub _max_length { 10 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/lib/Business/ISBN13.pm 
new/Business-ISBN-2.09/lib/Business/ISBN13.pm
--- old/Business-ISBN-2.07/lib/Business/ISBN13.pm       2014-01-03 
20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/lib/Business/ISBN13.pm       2014-09-21 
00:16:00.000000000 +0200
@@ -22,7 +22,7 @@
 
 my $debug = 0;
 
-$VERSION   = '2.07';
+$VERSION   = '2.09';
 
 sub _max_length { 13 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/t/github/3.t 
new/Business-ISBN-2.09/t/github/3.t
--- old/Business-ISBN-2.07/t/github/3.t 2014-01-03 20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/t/github/3.t 2014-09-21 00:16:00.000000000 +0200
@@ -3,7 +3,7 @@
 use_ok( 'Business::ISBN' );
 
 subtest good_checksum => sub {
-       my $string = '9789997122575';
+       my $string = '9789990022575';
        my $isbn = Business::ISBN->new( $string );
 
        is( $isbn->publisher_code, undef, 'Publisher code is bad' );
@@ -17,7 +17,7 @@
        };
 
 subtest bad_checksum => sub {
-       my $string = '9789997122576';
+       my $string = '9789990002576';
        my $isbn = Business::ISBN->new( $string );
 
        is( $isbn->is_valid_checksum, Business::ISBN::BAD_CHECKSUM() );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/t/isbn10.t 
new/Business-ISBN-2.09/t/isbn10.t
--- old/Business-ISBN-2.07/t/isbn10.t   2014-01-03 20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/t/isbn10.t   2014-09-21 00:16:00.000000000 +0200
@@ -20,7 +20,7 @@
 
 my $BAD_CHECKSUM_ISBN  = "0596527244";
 
-my $BAD_GROUP_ISBN     = "9997122576";
+my $BAD_GROUP_ISBN     = "9990022576";
 
 my $BAD_PUBLISHER_ISBN = "9165022222"; # 91-650-22222-?  Sweden (stops at 649)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/t/isbn13.t 
new/Business-ISBN-2.09/t/isbn13.t
--- old/Business-ISBN-2.07/t/isbn13.t   2014-01-03 20:20:21.000000000 +0100
+++ new/Business-ISBN-2.09/t/isbn13.t   2014-09-21 00:16:00.000000000 +0200
@@ -23,7 +23,7 @@
 
 my $BAD_CHECKSUM_ISBN  = "9780596527244";
 
-my $BAD_GROUP_ISBN     = "978-9997122576";
+my $BAD_GROUP_ISBN     = "978-9990022576";
 
 my $BAD_PUBLISHER_ISBN = "978-9165022222"; # 91-650-22222-?  Sweden (stops at 
649)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/t/step.t 
new/Business-ISBN-2.09/t/step.t
--- old/Business-ISBN-2.07/t/step.t     1970-01-01 01:00:00.000000000 +0100
+++ new/Business-ISBN-2.09/t/step.t     2014-09-21 00:16:00.000000000 +0200
@@ -0,0 +1,70 @@
+use Test::More 0.95;
+
+use strict;
+use warnings;
+
+my $class       = 'Business::ISBN';
+my @methods     = qw( increment decrement _step_article_code );
+my $isbn_string = '978-1-4493-9311-3'; # Mastering Perl
+
+my $isbn;
+
+subtest setup => sub {
+       use_ok( $class );
+       can_ok( $class, @methods );
+       };
+
+subtest make_isbn => sub {
+       $isbn = $class->new( $isbn_string );
+       isa_ok( $isbn, $class );
+       can_ok( $class, @methods );     
+       };
+
+subtest one_more => sub {
+       my $isbn     = $class->new( '978-1-4493-9311-3' );
+       isa_ok( $isbn, $class );
+       my $one_more = $class->new( '978-1-4493-9312-3' );
+       $one_more->fix_checksum;
+       isa_ok( $one_more, $class );
+
+       my $isbn_one_more = $isbn->increment;
+       isa_ok( $isbn_one_more, $class );
+       
+       is( $one_more->as_string, $isbn_one_more->as_string, 'One more matches' 
);
+       };
+
+subtest one_less => sub {
+       my $isbn     = $class->new( '978-1-4493-9311-3' );
+       isa_ok( $isbn, $class );
+       my $one_less = $class->new( '978-1-4493-9310-3' );
+       $one_less->fix_checksum;
+       isa_ok( $one_less, $class );
+
+       my $isbn_one_less = $isbn->decrement;
+       isa_ok( $isbn_one_less, $class );
+       
+       is( $one_less->as_string, $isbn_one_less->as_string, 'One less matches' 
);
+       };
+
+subtest too_little => sub {
+       my $isbn     = $class->new( '978-1-4493-0000-3' );
+       $isbn->fix_checksum;
+       isa_ok( $isbn, $class );
+
+       my $isbn_one_less = $isbn->decrement;
+
+       is( $isbn_one_less, Business::ISBN::ARTICLE_CODE_OUT_OF_RANGE(),
+               'Incrementing below 0 would be out of range' );
+       };
+
+subtest too_much => sub {
+       my $isbn     = $class->new( '978-1-4493-9999-3' );
+       $isbn->fix_checksum;
+       isa_ok( $isbn, $class );
+
+       my $isbn_one_more = $isbn->increment;
+       is( $isbn_one_more, Business::ISBN::ARTICLE_CODE_OUT_OF_RANGE(),
+               'Incrementing past 9999 would be out of range' );
+       };
+
+done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Business-ISBN-2.07/t/test_manifest 
new/Business-ISBN-2.09/t/test_manifest
--- old/Business-ISBN-2.07/t/test_manifest      2014-01-03 20:20:21.000000000 
+0100
+++ new/Business-ISBN-2.09/t/test_manifest      2014-09-21 00:16:00.000000000 
+0200
@@ -9,6 +9,7 @@
 valid_isbn_checksum.t
 xisbn10.t
 png_barcode.t
+step.t
 rt/27107.t
 rt/28843.t
 rt/29089.t

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to