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

nhandler-guest at users.alioth.debian.org nhandler-guest at users.alioth.debian.org
Thu Jul 2 19:25:39 UTC 2009


Author: nhandler-guest
Date: Thu Jul  2 19:25:31 2009
New Revision: 39153

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

Added:
    branches/upstream/libdata-section-perl/current/META.json
Removed:
    branches/upstream/libdata-section-perl/current/META.yml
    branches/upstream/libdata-section-perl/current/t/smoke-env.t
Modified:
    branches/upstream/libdata-section-perl/current/Changes
    branches/upstream/libdata-section-perl/current/LICENSE
    branches/upstream/libdata-section-perl/current/MANIFEST
    branches/upstream/libdata-section-perl/current/Makefile.PL
    branches/upstream/libdata-section-perl/current/README
    branches/upstream/libdata-section-perl/current/lib/Data/Section.pm
    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/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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/Changes (original)
+++ branches/upstream/libdata-section-perl/current/Changes Thu Jul  2 19:25:31 2009
@@ -1,4 +1,11 @@
 Revision history for Data-Section
+
+0.091820  2009-07-01 18:25:50 UTC
+          add docs on using ForMethod to avoid autocleaning (thanks, Kent
+          Fredric)
+
+0.006     2008-11-23
+          remove smoke tests that did nothing useful; thanks Florian
 
 0.005     2008-08-07
           rebuild to ensure directory entries in archive

Modified: branches/upstream/libdata-section-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/LICENSE?rev=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/LICENSE (original)
+++ branches/upstream/libdata-section-perl/current/LICENSE Thu Jul  2 19:25:31 2009
@@ -1,4 +1,4 @@
-This software is copyright (c) 2008 by Ricardo SIGNES.
+This software is copyright (c) 2009 by Ricardo SIGNES.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as perl itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2008 by Ricardo SIGNES.
+This software is Copyright (c) 2009 by Ricardo SIGNES.
 
 This is free software, licensed under:
 
@@ -270,7 +270,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2008 by Ricardo SIGNES.
+This software is Copyright (c) 2009 by Ricardo SIGNES.
 
 This is free software, licensed under:
 

Modified: branches/upstream/libdata-section-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/MANIFEST?rev=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/MANIFEST (original)
+++ branches/upstream/libdata-section-perl/current/MANIFEST Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 Changes
 LICENSE
 MANIFEST
-META.yml
+META.json
 Makefile.PL
 README
 lib/Data/Section.pm
@@ -14,5 +14,4 @@
 t/lib/I/Parent.pm
 t/lib/NoData.pm
 t/lib/Parent.pm
-t/release-perl-critic.t
-t/smoke-env.t
+t/release-perl-critic.t

Added: 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=39153&op=file
==============================================================================
--- branches/upstream/libdata-section-perl/current/META.json (added)
+++ branches/upstream/libdata-section-perl/current/META.json Thu Jul  2 19:25:31 2009
@@ -1,0 +1,21 @@
+{
+   "resources" : {
+      "repository" : "http://github.com/rjbs/data-section/tree"
+   },
+   "meta-spec" : {
+      "version" : 1.4,
+      "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
+   },
+   "generated_by" : "Dist::Zilla::Plugin::MetaJSON version 1.091480",
+   "version" : "0.091820",
+   "name" : "Data-Section",
+   "author" : [
+      "Ricardo SIGNES <rjbs at cpan.org>"
+   ],
+   "license" : "perl",
+   "requires" : {
+      "Class::ISA" : "0",
+      "Sub::Exporter" : "0.979"
+   },
+   "abstract" : "read multiple hunks of data out of your DATA section"
+}

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/Makefile.PL (original)
+++ branches/upstream/libdata-section-perl/current/Makefile.PL Thu Jul  2 19:25:31 2009
@@ -8,8 +8,8 @@
   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.005',
+  ABSTRACT  => 'read\ multiple\ hunks\ of\ data\ out\ of\ your\ DATA\ section',
+  VERSION   => '0.091820',
   EXE_FILES => [ qw() ],
   (eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
   PREREQ_PM    => {

Modified: branches/upstream/libdata-section-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-section-perl/current/README?rev=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/README (original)
+++ branches/upstream/libdata-section-perl/current/README Thu Jul  2 19:25:31 2009
@@ -1,11 +1,11 @@
 
 
 This archive contains the distribution Data-Section, version
-0.005:
+0.091820:
 
   read multiple hunks of data out of your DATA section
 
-This software is copyright (c) 2008 by Ricardo SIGNES.
+This software is copyright (c) 2009 by Ricardo SIGNES.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as perl itself.

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/lib/Data/Section.pm (original)
+++ branches/upstream/libdata-section-perl/current/lib/Data/Section.pm Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Data::Section;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 # ABSTRACT: read multiple hunks of data out of your DATA section
 
@@ -111,38 +111,38 @@
 
 =head1 VERSION
 
-version 0.005
+version 0.091820
 
 =head1 SYNOPSIS
 
-    package Letter::Resignation;
-    use Data::Section -setup;
-
-    sub quit {
-      my ($class, $angry, %arg) = @_;
-
-      my $template = $self->section_data(
-        ($angry ? "angry_" : "professional_") . "letter"
-      );
-
-      return fill_in($$template, \%arg);
-    }
-
-    __DATA__
-    __[ angry_letter ]__
-    Dear jerks,
-
-      I quit!
-
-    -- 
-    {{ $name }}
-    __[ professional_letter ]__
-    Dear {{ $boss }},
-
-      I quit, jerks!
-
-    -- 
-    {{ $name }}
+  package Letter::Resignation;
+  use Data::Section -setup;
+
+  sub quit {
+    my ($class, $angry, %arg) = @_;
+
+    my $template = $self->section_data(
+      ($angry ? "angry_" : "professional_") . "letter"
+    );
+
+    return fill_in($$template, \%arg);
+  }
+
+  __DATA__
+  __[ angry_letter ]__
+  Dear jerks,
+
+    I quit!
+
+  -- 
+  {{ $name }}
+  __[ professional_letter ]__
+  Dear {{ $boss }},
+
+    I quit, jerks!
+
+  -- 
+  {{ $name }}
 
 =head1 DESCRIPTION
 
@@ -159,25 +159,25 @@
 
 To get the methods exported by Data::Section, you must import like this:
 
-    use Data::Section -setup;
+  use Data::Section -setup;
 
 Optional arguments may be given to Data::Section like this:
 
-    use Data::Section -setup => { ... };
+  use Data::Section -setup => { ... };
 
 Valid arguments are:
 
-    inherit - if true, allow packages to inherit the data of the packages
-              from which they inherit; default: true
-
-    header_re - if given, changes the regex used to find section headers
-                in the data section; it should leave the section name in $1
+  inherit - if true, allow packages to inherit the data of the packages
+            from which they inherit; default: true
+
+  header_re - if given, changes the regex used to find section headers
+              in the data section; it should leave the section name in $1
 
 Three methods are exported by Data::Section:
 
 =head2 section_data
 
-    my $string_ref = $pkg->section_data($name); 
+  my $string_ref = $pkg->section_data($name); 
 
 This method returns a reference to a string containing the data from the name
 section, either in the invocant's C<DATA> section or in that of one of its
@@ -186,7 +186,7 @@
 
 By default, named sections are delimited by lines that look like this:
 
-    __[ name ]__
+  __[ name ]__
 
 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
@@ -194,7 +194,7 @@
 
 =head2 merged_section_data
 
-    my $data = $pkg->merged_section_data;
+  my $data = $pkg->merged_section_data;
 
 This method returns a hashref containing all the data extracted from the
 package data for all the classes from which the invocant inherits -- as long as
@@ -203,11 +203,11 @@
 
 In other words, given this inheritence tree:
 
-    A
-     \
-      B   C
-       \ /
-        D
+  A
+   \
+    B   C
+     \ /
+      D
 
 ...if Data::Section was imported by A, then when D's C<merged_section_data> is
 invoked, C's data section will not be considered.  (This prevents the read
@@ -218,7 +218,7 @@
 
 =head2 local_section_data
 
-    my $data = $pkg->local_section_data;
+  my $data = $pkg->local_section_data;
 
 This method returns a hashref containing all the data extracted from the
 package on which the method was invoked.  If called on an object, it will
@@ -228,14 +228,52 @@
 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.
 
+=head1 TIPS AND TRICKS
+
+=head2 MooseX::Declare and namespace::autoclean
+
+The L<namespace::autoclean|namespace::autoclean> library automatically cleans
+foreign routines from a class, including those imported by Data::Section.
+
+L<MooseX::Declare|MooseX::Declare> does the same thing, and can also cause your
+C<__DATA__> section to appear outside your class's package.
+
+These are easy to address.  The
+L<Sub::Exporter::ForMethods|Sub::Exporter::ForMethods> library provides an
+installer that will cause installed methods to appear to come from the class
+and avoid autocleaning.  Using an explicit C<package> statement will keep the
+data section in the correct package.
+
+   package Foo;
+
+   use MooseX::Declare;
+   class Foo {
+
+     # Utility to tell Sub::Exporter modules to export methods.
+     use Sub::Exporter::ForMethods qw( method_installer );
+
+     # method_installer returns a sub.
+     use Data::Section { installer => method_installer }, -setup;
+
+     method my_method {
+        my $content_ref = $self->section_data('SectionA');
+
+        print $$content_ref;
+     }
+   }
+
+   __DATA__
+   __[ SectionA ]__
+   Hello, world.
+
 =head1 SEE ALSO
 
 L<Inline::Files|Inline::Files> does something that is at first look similar,
 but it works with source filters, and contains the warning:
 
-    It is possible that this module may overwrite the source code in files that
-    use it. To protect yourself against this possibility, you are strongly
-    advised to use the -backup option described in "Safety first".
+  It is possible that this module may overwrite the source code in files that
+  use it. To protect yourself against this possibility, you are strongly
+  advised to use the -backup option described in "Safety first".
 
 Enough said.
 
@@ -245,7 +283,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-This software is copyright (c) 2008 by Ricardo SIGNES.
+This software is copyright (c) 2009 by Ricardo SIGNES.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as perl itself.

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Child.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Child.pm Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Child;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use Godfather;
 use base qw(Parent Godfather);

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Godfather.pm Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Godfather;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 1;
 __DATA__

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Grandchild.pm Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Grandchild;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use base 'Child';
 

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=39153&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 Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package I::Child;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use Godfather;
 use base qw(I::Parent Godfather);

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=39153&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 Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package I::Grandchild;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use base 'I::Child';
 

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=39153&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 Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package I::Parent;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use Data::Section -setup;
 

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/NoData.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/NoData.pm Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package NoData;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use Data::Section -setup;
 

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=39153&op=diff
==============================================================================
--- branches/upstream/libdata-section-perl/current/t/lib/Parent.pm (original)
+++ branches/upstream/libdata-section-perl/current/t/lib/Parent.pm Thu Jul  2 19:25:31 2009
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 package Parent;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
 
 use Data::Section -setup => { inherit => 0 };
 




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