r51776 - in /branches/upstream/libdata-section-perl/current: ./ lib/Data/ t/ t/lib/ t/lib/I/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Jan 30 01:28:42 UTC 2010


Author: jawnsy-guest
Date: Sat Jan 30 01:28:37 2010
New Revision: 51776

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=51776
Log:
[svn-upgrade] Integrating new upstream version, libdata-section-perl (0.100270)

Modified:
    branches/upstream/libdata-section-perl/current/Changes
    branches/upstream/libdata-section-perl/current/LICENSE
    branches/upstream/libdata-section-perl/current/META.json
    branches/upstream/libdata-section-perl/current/META.yml
    branches/upstream/libdata-section-perl/current/Makefile.PL
    branches/upstream/libdata-section-perl/current/README
    branches/upstream/libdata-section-perl/current/dist.ini
    branches/upstream/libdata-section-perl/current/lib/Data/Section.pm
    branches/upstream/libdata-section-perl/current/t/basic.t
    branches/upstream/libdata-section-perl/current/t/lib/Child.pm
    branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm
    branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm
    branches/upstream/libdata-section-perl/current/t/lib/I/Child.pm
    branches/upstream/libdata-section-perl/current/t/lib/I/Grandchild.pm
    branches/upstream/libdata-section-perl/current/t/lib/I/Parent.pm
    branches/upstream/libdata-section-perl/current/t/lib/NoData.pm
    branches/upstream/libdata-section-perl/current/t/lib/NoName.pm
    branches/upstream/libdata-section-perl/current/t/lib/Parent.pm

Modified: branches/upstream/libdata-section-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/Changes?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/Changes (original)
+++ branches/upstream/libdata-section-perl/current/Changes Sat Jan 30 01:28:37 2010
@@ -1,4 +1,9 @@
 Revision history for Data-Section
+
+0.100270  2010-01-27 22:43:33 America/New_York
+          switch from Class::ISA to MRO::Compat
+          added *_section_names
+          eliminate some duplicated code
 
 0.093410  2009-12-07 18:45:56 America/New_York
           allow data before first marker if default_name given

Modified: branches/upstream/libdata-section-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/LICENSE?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/LICENSE (original)
+++ branches/upstream/libdata-section-perl/current/LICENSE Sat Jan 30 01:28:37 2010
@@ -1,4 +1,4 @@
-This software is copyright (c) 2009 by Ricardo SIGNES.
+This software is copyright (c) 2010 by Ricardo SIGNES.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2009 by Ricardo SIGNES.
+This software is Copyright (c) 2010 by Ricardo SIGNES.
 
 This is free software, licensed under:
 
@@ -270,7 +270,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2009 by Ricardo SIGNES.
+This software is Copyright (c) 2010 by Ricardo SIGNES.
 
 This is free software, licensed under:
 

Modified: branches/upstream/libdata-section-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/META.json?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/META.json (original)
+++ branches/upstream/libdata-section-perl/current/META.json Sat Jan 30 01:28:37 2010
@@ -2,20 +2,22 @@
    "resources" : {
       "repository" : "http://github.com/rjbs/data-section"
    },
+   "generated_by" : "Dist::Zilla version 1.100160",
    "meta-spec" : {
       "version" : 1.4,
       "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
    },
-   "generated_by" : "Dist::Zilla version 1.093400",
-   "version" : "0.093410",
+   "version" : "0.100270",
    "name" : "Data-Section",
    "author" : [
       "Ricardo SIGNES <rjbs at cpan.org>"
    ],
    "license" : "perl",
    "requires" : {
+      "Test::More" : "0.88",
+      "ExtUtils::MakeMaker" : "6.11",
       "Sub::Exporter" : "0.979",
-      "Class::ISA" : "0"
+      "MRO::Compat" : "0.09"
    },
    "abstract" : "read multiple hunks of data out of your DATA section"
 }

Modified: branches/upstream/libdata-section-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/META.yml?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/META.yml (original)
+++ branches/upstream/libdata-section-perl/current/META.yml Sat Jan 30 01:28:37 2010
@@ -2,15 +2,17 @@
 abstract: 'read multiple hunks of data out of your DATA section'
 author:
   - 'Ricardo SIGNES <rjbs at cpan.org>'
-generated_by: 'Dist::Zilla version 1.093400'
+generated_by: 'Dist::Zilla version 1.100160'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4
 name: Data-Section
 requires:
-  Class::ISA: 0
+  ExtUtils::MakeMaker: 6.11
+  MRO::Compat: 0.09
   Sub::Exporter: 0.979
+  Test::More: 0.88
 resources:
   repository: http://github.com/rjbs/data-section
-version: 0.093410
+version: 0.100270

Modified: branches/upstream/libdata-section-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/Makefile.PL?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/Makefile.PL (original)
+++ branches/upstream/libdata-section-perl/current/Makefile.PL Sat Jan 30 01:28:37 2010
@@ -4,20 +4,34 @@
 
 
 
-use ExtUtils::MakeMaker;
+use ExtUtils::MakeMaker 6.11;
 
-WriteMakefile(
-  DISTNAME  => 'Data-Section',
-  NAME      => 'Data::Section',
-  AUTHOR    => "Ricardo\ SIGNES\ \<rjbs\@cpan\.org\>",
-  ABSTRACT  => "read\ multiple\ hunks\ of\ data\ out\ of\ your\ DATA\ section",
-  VERSION   => '0.093410',
-  EXE_FILES => [ qw() ],
-  (eval { ExtUtils::MakeMaker->VERSION(6.31) } ? (LICENSE => 'perl') : ()),
-  PREREQ_PM    => {
-    "Sub::Exporter" => '0.979',
-    "Class::ISA" => '0',
-  },
-  test => {TESTS => 't/*.t'}
-);
 
+
+my %WriteMakefileArgs = (
+                       'test' => {
+                                   'TESTS' => 't/*.t'
+                                 },
+                       'NAME' => 'Data::Section',
+                       'DISTNAME' => 'Data-Section',
+                       'AUTHOR' => 'Ricardo SIGNES <rjbs at cpan.org>',
+                       'ABSTRACT' => 'read multiple hunks of data out of your DATA section',
+                       'EXE_FILES' => [],
+                       'VERSION' => '0.100270',
+                       'LICENSE' => 'perl',
+                       'PREREQ_PM' => {
+                                        'Test::More' => '0.88',
+                                        'ExtUtils::MakeMaker' => '6.11',
+                                        'Sub::Exporter' => '0.979',
+                                        'MRO::Compat' => '0.09'
+                                      }
+                     );
+
+
+delete $WriteMakefileArgs{LICENSE}
+  unless eval { ExtUtils::MakeMaker->VERSION(6.31) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+

Modified: branches/upstream/libdata-section-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/README?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/README (original)
+++ branches/upstream/libdata-section-perl/current/README Sat Jan 30 01:28:37 2010
@@ -1,11 +1,11 @@
 
 
 This archive contains the distribution Data-Section, version
-0.093410:
+0.100270:
 
   read multiple hunks of data out of your DATA section
 
-This software is copyright (c) 2009 by Ricardo SIGNES.
+This software is copyright (c) 2010 by Ricardo SIGNES.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.

Modified: branches/upstream/libdata-section-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/dist.ini?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/dist.ini (original)
+++ branches/upstream/libdata-section-perl/current/dist.ini Sat Jan 30 01:28:37 2010
@@ -5,7 +5,8 @@
 
 [Prereq]
 Sub::Exporter = 0.979
-Class::ISA    = 0
+MRO::Compat   = 0.09  ; bugfixes
+Test::More    = 0.88  ; done_testing
 
 [@RJBS]
 

Modified: branches/upstream/libdata-section-perl/current/lib/Data/Section.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/lib/Data/Section.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/lib/Data/Section.pm (original)
+++ branches/upstream/libdata-section-perl/current/lib/Data/Section.pm Sat Jan 30 01:28:37 2010
@@ -1,10 +1,10 @@
 use strict;
 use warnings;
 package Data::Section;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 # ABSTRACT: read multiple hunks of data out of your DATA section
 
-use Class::ISA;
+use MRO::Compat 0.09;
 use Sub::Exporter 0.979 -setup => {
   groups     => { setup => \'_mk_reader_group' },
   collectors => { INIT => sub { $_[0] = { into => $_[1]->{into} } } },
@@ -30,7 +30,7 @@
     my $template = $stash{ $pkg } = { };
 
     my $dh = do { no strict 'refs'; \*{"$pkg\::DATA"} }; ## no critic Strict
-    return $stash{ $pkg} unless defined fileno *$dh;
+    return $stash{ $pkg } unless defined fileno *$dh;
 
     my $current;
     if ($arg->{default_name}) {
@@ -55,6 +55,12 @@
     return $stash{ $pkg };
   };
 
+  $export{local_section_data_names} = sub {
+    my ($self) = @_;
+    my $method = $export{local_section_data};
+    return keys %{ $self->$method };
+  };
+
   $export{merged_section_data} =
     !$arg->{inherit} ? $export{local_section_data} : sub {
 
@@ -64,7 +70,7 @@
     my $lsd = $export{local_section_data};
 
     my %merged;
-    for my $class (Class::ISA::self_and_super_path($pkg)) {
+    for my $class (@{ mro::get_linear_isa($pkg) }) {
       # in case of c3 + non-$base item showing up
       next unless $class->isa($base);
       my $sec_data = $class->$lsd;
@@ -77,25 +83,30 @@
     return \%merged;
   };
 
+  $export{merged_section_data_names} = sub {
+    my ($self) = @_;
+    my $method = $export{merged_section_data};
+    return keys %{ $self->$method };
+  };
+
   $export{section_data} = sub {
     my ($self, $name) = @_;
     my $pkg = ref $self ? ref $self : $self;
 
-    my @to_check = $arg->{inherit}
-                 ? Class::ISA::self_and_super_path($pkg) 
-                 : $pkg;
-
-    my $lsd = $export{local_section_data}; # in case they use another name
-
-    for my $class (@to_check) {
-      # in case of c3 + non-$base item showing up
-      next unless $class->isa($base);
-
-      return $class->$lsd->{$name}
-        if exists $class->$lsd->{$name};
-    }
-
-    return undef; ## no critic Undef
+    my $prefix = $arg->{inherit} ? 'merged' : 'local';
+    my $method = "$prefix\_section_data";
+
+    my $data = $self->$method;
+
+    return $data->{ $name };
+  };
+
+  $export{section_data_names} = sub {
+    my ($self) = @_;
+
+    my $prefix = $arg->{inherit} ? 'merged' : 'local';
+    my $method = "$prefix\_section_data_names";
+    return $self->$method;
   };
 
   return \%export;
@@ -113,7 +124,7 @@
 
 =head1 VERSION
 
-version 0.093410
+version 0.100270
 
 =head1 SYNOPSIS
 
@@ -197,6 +208,13 @@
 You can use as many underscores as you want, and the space around the name is
 optional.  This pattern can be configured with the C<header_re> option (see
 above).
+
+=head2 section_data_names
+
+  my @names = $pkg->section_data_names;
+
+This returns a list of all the names that will be recognized by the
+C<section_data> method.
 
 =head2 merged_section_data
 
@@ -222,6 +240,13 @@
 The keys in the returned hashref are the section names, and the values are
 B<references to> the strings extracted from the data sections.
 
+=head2 merged_section_data_names
+
+  my @names = $pkg->merged_section_data_names;
+
+This returns a list of all the names that will be recognized by the
+C<merged_section_data> method.
+
 =head2 local_section_data
 
   my $data = $pkg->local_section_data;
@@ -233,6 +258,13 @@
 This method needs to be used carefull, because it's weird.  It returns only the
 data for the package on which it was invoked.  If the package on which it was
 invoked has no data sections, it returns an empty hashref.
+
+=head2 local_section_data_names
+
+  my @names = $pkg->local_section_data_names;
+
+This returns a list of all the names that will be recognized by the
+C<local_section_data> method.
 
 =head1 TIPS AND TRICKS
 
@@ -289,7 +321,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2009 by Ricardo SIGNES.
+This software is copyright (c) 2010 by Ricardo SIGNES.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.

Modified: branches/upstream/libdata-section-perl/current/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/basic.t?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/basic.t (original)
+++ branches/upstream/libdata-section-perl/current/t/basic.t Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 use lib 't/lib';
-use Test::More tests => 20;
+use Test::More;
 
 use Parent;
 use Child;
@@ -39,15 +39,90 @@
   );
 }
 
+# The classes that do not begin with I:: are non-inheriting, so we do not
+# expect to see (for example) the parent's "b" section propagated to the
+# grandchild. -- rjbs, 2010-01-27
 is_deeply(Parent    ->section_data('a'), \"1\n",   "Parent's a");
 is_deeply(Parent    ->section_data('b'), \"2\n",   "Parent's b");
 is_deeply(Grandchild->section_data('a'), \"111\n", "Grandchild's a");
 is_deeply(Grandchild->section_data('b'), undef,   "Grandchild's b (none)");
 
+is_deeply(
+  [ sort Parent->section_data_names ],
+  [ qw(a b c) ],
+  "Parent section data names",
+);
+
+is_deeply(
+  [ sort Parent->local_section_data_names ],
+  [ qw(a b c) ],
+  "Parent local section data names",
+);
+
+is_deeply(
+  [ sort Parent->merged_section_data_names ],
+  [ qw(a b c) ],
+  "Parent merged section data names",
+);
+
+is_deeply(
+  [ sort Child->section_data_names ],
+  [ qw(b c d) ],
+  "Child section data names",
+);
+
+is_deeply(
+  [ sort Child->local_section_data_names ],
+  [ qw(b c d) ],
+  "Child local section data names",
+);
+
+is_deeply(
+  [ sort Child->merged_section_data_names ],
+  [ qw(b c d) ],
+  "Child merged section data names",
+);
+
 is_deeply(I::Parent    ->section_data('a'), \"1\n",   "I::Parent's a");
 is_deeply(I::Parent    ->section_data('b'), \"2\n",   "I::Parent's b");
 is_deeply(I::Grandchild->section_data('a'), \"111\n", "I::Grandchild's a");
 is_deeply(I::Grandchild->section_data('b'), \"22\n",  "I::Grandchild's b (via Child)");
+
+is_deeply(
+  [ sort I::Parent->section_data_names ],
+  [ qw(a b c) ],
+  "I::Parent section data names",
+);
+
+is_deeply(
+  [ sort I::Parent->local_section_data_names ],
+  [ qw(a b c) ],
+  "I::Parent local section data names",
+);
+
+is_deeply(
+  [ sort I::Parent->merged_section_data_names ],
+  [ qw(a b c) ],
+  "I::Parent merged section data names",
+);
+
+is_deeply(
+  [ sort I::Child->section_data_names ],
+  [ qw(a b c d) ],
+  "I::Child merged section data names",
+);
+
+is_deeply(
+  [ sort I::Child->local_section_data_names ],
+  [ qw(b c d) ],
+  "I::Child local section data names",
+);
+
+is_deeply(
+  [ sort I::Child->merged_section_data_names ],
+  [ qw(a b c d) ],
+  "I::Child merged section data names",
+);
 
 is_deeply(
   I::Grandchild->merged_section_data,
@@ -62,3 +137,5 @@
   { a => \"1\n", b => \"2\n" },
   "default name in NoName",
 );
+
+done_testing;

Modified: branches/upstream/libdata-section-perl/current/t/lib/Child.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/Child.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Child.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Child.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Child;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use Godfather;
 use base qw(Parent Godfather);
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Godfather;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 1;
 __DATA__
 __[a]__

Modified: branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Grandchild;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use base 'Child';
 
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/I/Child.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/I/Child.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/I/Child.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/I/Child.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package I::Child;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use Godfather;
 use base qw(I::Parent Godfather);
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/I/Grandchild.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/I/Grandchild.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/I/Grandchild.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/I/Grandchild.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package I::Grandchild;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use base 'I::Child';
 
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/I/Parent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/I/Parent.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/I/Parent.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/I/Parent.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package I::Parent;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use Data::Section -setup;
 
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/NoData.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/NoData.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/NoData.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/NoData.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package NoData;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use Data::Section -setup;
 
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/NoName.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/NoName.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/NoName.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/NoName.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package NoName;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use Data::Section -setup => { default_name => 'a' };
 
 1;

Modified: branches/upstream/libdata-section-perl/current/t/lib/Parent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/t/lib/Parent.pm?rev=51776&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Parent.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Parent.pm Sat Jan 30 01:28:37 2010
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Parent;
-our $VERSION = '0.093410';
+our $VERSION = '0.100270';
 use Data::Section -setup => { inherit => 0 };
 
 1;




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