r71468 - in /branches/upstream/libcpan-changes-perl/current: Changes MANIFEST META.yml lib/CPAN/Changes.pm t/corpus/different-indentation.changes t/corpus/group-brackets.changes t/read_different-indentation.t t/read_group-brackets.t t/self.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Mar 16 01:32:54 UTC 2011


Author: jawnsy-guest
Date: Wed Mar 16 01:32:46 2011
New Revision: 71468

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=71468
Log:
[svn-upgrade] new version libcpan-changes-perl (0.08)

Added:
    branches/upstream/libcpan-changes-perl/current/t/corpus/different-indentation.changes
    branches/upstream/libcpan-changes-perl/current/t/corpus/group-brackets.changes
    branches/upstream/libcpan-changes-perl/current/t/read_different-indentation.t
    branches/upstream/libcpan-changes-perl/current/t/read_group-brackets.t
Modified:
    branches/upstream/libcpan-changes-perl/current/Changes
    branches/upstream/libcpan-changes-perl/current/MANIFEST
    branches/upstream/libcpan-changes-perl/current/META.yml
    branches/upstream/libcpan-changes-perl/current/lib/CPAN/Changes.pm
    branches/upstream/libcpan-changes-perl/current/t/self.t

Modified: branches/upstream/libcpan-changes-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/Changes?rev=71468&op=diff
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/Changes (original)
+++ branches/upstream/libcpan-changes-perl/current/Changes Wed Mar 16 01:32:46 2011
@@ -1,4 +1,10 @@
 Revision history for perl module CPAN::Changes
+
+0.08 2011-03-14
+
+  - Handle inconsistent indentation between releases
+
+  - Be more strict about parsing rules for grouping lines
 
 0.07 2011-03-03
 

Modified: branches/upstream/libcpan-changes-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/MANIFEST?rev=71468&op=diff
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/MANIFEST (original)
+++ branches/upstream/libcpan-changes-perl/current/MANIFEST Wed Mar 16 01:32:46 2011
@@ -17,7 +17,9 @@
 META.yml
 README
 t/corpus/basic.changes
+t/corpus/different-indentation.changes
 t/corpus/dist-zilla.changes
+t/corpus/group-brackets.changes
 t/corpus/group.changes
 t/corpus/line-continuation.changes
 t/corpus/multiple_releases.changes
@@ -26,6 +28,8 @@
 t/corpus/space-before-date.changes
 t/dist-zilla-changes.t
 t/read_basic.t
+t/read_different-indentation.t
+t/read_group-brackets.t
 t/read_group.t
 t/read_line-continuation.t
 t/read_multiple_releases.t

Modified: branches/upstream/libcpan-changes-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/META.yml?rev=71468&op=diff
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/META.yml (original)
+++ branches/upstream/libcpan-changes-perl/current/META.yml Wed Mar 16 01:32:46 2011
@@ -26,4 +26,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: http://github.com/bricas/cpan-changes
-version: 0.07
+version: 0.08

Modified: branches/upstream/libcpan-changes-perl/current/lib/CPAN/Changes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/lib/CPAN/Changes.pm?rev=71468&op=diff
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/lib/CPAN/Changes.pm (original)
+++ branches/upstream/libcpan-changes-perl/current/lib/CPAN/Changes.pm Wed Mar 16 01:32:46 2011
@@ -8,7 +8,7 @@
 use Scalar::Util ();
 use version      ();
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 sub new {
     my $class = shift;
@@ -64,7 +64,7 @@
         }
 
         # Grouping
-        if ( $l =~ m{^\s+\[\s*(.+)\s*\]} ) {
+        if ( $l =~ m{^\s+\[\s*(.+)\s*\]\s*$} ) {
             $ingroup = $1;
             $releases[ -1 ]->add_group( $1 );
             next;
@@ -82,6 +82,13 @@
         }
 
         $l =~ s{^$indent}{};
+
+        # Inconsistent indentation between releases
+        if( $l =~ m{^\s} && !@{ $releases[ -1 ]->changes( $ingroup ) } ) {
+            $l =~ m{^(\s+)};
+            $indent = $1;
+            $l =~ s{^\s+}{};
+        }
 
         # Change line cont'd
         if ( $l =~ m{^\s} ) {

Added: branches/upstream/libcpan-changes-perl/current/t/corpus/different-indentation.changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/t/corpus/different-indentation.changes?rev=71468&op=file
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/t/corpus/different-indentation.changes (added)
+++ branches/upstream/libcpan-changes-perl/current/t/corpus/different-indentation.changes Wed Mar 16 01:32:46 2011
@@ -1,0 +1,5 @@
+0.02 2010-06-17
+ - New version
+
+0.01 2010-06-16
+    - Initial release

Added: branches/upstream/libcpan-changes-perl/current/t/corpus/group-brackets.changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/t/corpus/group-brackets.changes?rev=71468&op=file
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/t/corpus/group-brackets.changes (added)
+++ branches/upstream/libcpan-changes-perl/current/t/corpus/group-brackets.changes Wed Mar 16 01:32:46 2011
@@ -1,0 +1,4 @@
+0.01 2010-06-16
+ [Group 1]
+ - Initial release
+   [not a group], seriously.

Added: branches/upstream/libcpan-changes-perl/current/t/read_different-indentation.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/t/read_different-indentation.t?rev=71468&op=file
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/t/read_different-indentation.t (added)
+++ branches/upstream/libcpan-changes-perl/current/t/read_different-indentation.t Wed Mar 16 01:32:46 2011
@@ -1,0 +1,45 @@
+use strict;
+use warnings;
+
+use Test::More tests => 16;
+
+use_ok( 'CPAN::Changes' );
+
+my $changes = CPAN::Changes->load( 't/corpus/different-indentation.changes' );
+
+isa_ok( $changes, 'CPAN::Changes' );
+is( $changes->preamble, '', 'no preamble' );
+
+my @releases = $changes->releases;
+
+is( scalar @releases, 2, 'has 2 releases' );
+
+isa_ok( $releases[ 0 ], 'CPAN::Changes::Release' );
+is( $releases[ 0 ]->version, '0.01',       'version' );
+is( $releases[ 0 ]->date,    '2010-06-16', 'date' );
+is_deeply(
+    $releases[ 0 ]->changes,
+    { '' => [ 'Initial release' ] },
+    'full changes'
+);
+is_deeply( [ $releases[ 0 ]->groups ], [ '' ], 'only the main group' );
+is_deeply(
+    $releases[ 0 ]->changes( '' ),
+    [ 'Initial release' ],
+    'one change line'
+);
+
+isa_ok( $releases[ 1 ], 'CPAN::Changes::Release' );
+is( $releases[ 1 ]->version, '0.02',       'version' );
+is( $releases[ 1 ]->date,    '2010-06-17', 'date' );
+is_deeply(
+    $releases[ 1 ]->changes,
+    { '' => [ 'New version' ] },
+    'full changes'
+);
+is_deeply( [ $releases[ 1 ]->groups ], [ '' ], 'only the main group' );
+is_deeply(
+    $releases[ 1 ]->changes( '' ),
+    [ 'New version' ],
+    'one change line'
+);

Added: branches/upstream/libcpan-changes-perl/current/t/read_group-brackets.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/t/read_group-brackets.t?rev=71468&op=file
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/t/read_group-brackets.t (added)
+++ branches/upstream/libcpan-changes-perl/current/t/read_group-brackets.t Wed Mar 16 01:32:46 2011
@@ -1,0 +1,29 @@
+use strict;
+use warnings;
+
+use Test::More tests => 10;
+
+use_ok( 'CPAN::Changes' );
+
+my $changes = CPAN::Changes->load( 't/corpus/group-brackets.changes' );
+
+isa_ok( $changes, 'CPAN::Changes' );
+is( $changes->preamble, '', 'no preamble' );
+
+my @releases = $changes->releases;
+
+is( scalar @releases, 1, 'has 1 release' );
+isa_ok( $releases[ 0 ], 'CPAN::Changes::Release' );
+is( $releases[ 0 ]->version, '0.01',       'version' );
+is( $releases[ 0 ]->date,    '2010-06-16', 'date' );
+is_deeply(
+    $releases[ 0 ]->changes,
+    { 'Group 1' => [ 'Initial release [not a group], seriously.' ] },
+    'full changes'
+);
+is_deeply( [ $releases[ 0 ]->groups ], [ 'Group 1' ], 'one group' );
+is_deeply(
+    $releases[ 0 ]->changes( 'Group 1' ),
+    [ 'Initial release [not a group], seriously.' ],
+    'one change line'
+);

Modified: branches/upstream/libcpan-changes-perl/current/t/self.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-changes-perl/current/t/self.t?rev=71468&op=diff
==============================================================================
--- branches/upstream/libcpan-changes-perl/current/t/self.t (original)
+++ branches/upstream/libcpan-changes-perl/current/t/self.t Wed Mar 16 01:32:46 2011
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 10;
+use Test::More tests => 11;
 
 use_ok( 'CPAN::Changes' );
 




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