r39155 - in /trunk/libdata-section-perl: ./ debian/ 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:27:09 UTC 2009
Author: nhandler-guest
Date: Thu Jul 2 19:27:03 2009
New Revision: 39155
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39155
Log:
Update to 0.091820
Added:
trunk/libdata-section-perl/META.json
- copied unchanged from r39154, branches/upstream/libdata-section-perl/current/META.json
Removed:
trunk/libdata-section-perl/META.yml
trunk/libdata-section-perl/t/smoke-env.t
Modified:
trunk/libdata-section-perl/Changes
trunk/libdata-section-perl/LICENSE
trunk/libdata-section-perl/MANIFEST
trunk/libdata-section-perl/Makefile.PL
trunk/libdata-section-perl/README
trunk/libdata-section-perl/debian/changelog
trunk/libdata-section-perl/lib/Data/Section.pm
trunk/libdata-section-perl/t/lib/Child.pm
trunk/libdata-section-perl/t/lib/Godfather.pm
trunk/libdata-section-perl/t/lib/Grandchild.pm
trunk/libdata-section-perl/t/lib/I/Child.pm
trunk/libdata-section-perl/t/lib/I/Grandchild.pm
trunk/libdata-section-perl/t/lib/I/Parent.pm
trunk/libdata-section-perl/t/lib/NoData.pm
trunk/libdata-section-perl/t/lib/Parent.pm
Modified: trunk/libdata-section-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/Changes?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/Changes (original)
+++ trunk/libdata-section-perl/Changes Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/LICENSE?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/LICENSE (original)
+++ trunk/libdata-section-perl/LICENSE Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/MANIFEST?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/MANIFEST (original)
+++ trunk/libdata-section-perl/MANIFEST Thu Jul 2 19:27:03 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
Modified: trunk/libdata-section-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/Makefile.PL?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/Makefile.PL (original)
+++ trunk/libdata-section-perl/Makefile.PL Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/README?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/README (original)
+++ trunk/libdata-section-perl/README Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/debian/changelog?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/debian/changelog (original)
+++ trunk/libdata-section-perl/debian/changelog Thu Jul 2 19:27:03 2009
@@ -1,3 +1,9 @@
+libdata-section-perl (0.091820-1) UNRELEASED; urgency=low
+
+ * (NOT RELEASED YET) New upstream release
+
+ -- Nathan Handler <nhandler at ubuntu.com> Thu, 02 Jul 2009 19:26:44 +0000
+
libdata-section-perl (0.005-2) UNRELEASED; urgency=low
* debian/watch: Update to ignore development releases.
Modified: trunk/libdata-section-perl/lib/Data/Section.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/lib/Data/Section.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/lib/Data/Section.pm (original)
+++ trunk/libdata-section-perl/lib/Data/Section.pm Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/t/lib/Child.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/Child.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/Child.pm (original)
+++ trunk/libdata-section-perl/t/lib/Child.pm Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/t/lib/Godfather.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/Godfather.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/Godfather.pm (original)
+++ trunk/libdata-section-perl/t/lib/Godfather.pm Thu Jul 2 19:27:03 2009
@@ -1,7 +1,7 @@
use strict;
use warnings;
package Godfather;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
1;
__DATA__
Modified: trunk/libdata-section-perl/t/lib/Grandchild.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/Grandchild.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/Grandchild.pm (original)
+++ trunk/libdata-section-perl/t/lib/Grandchild.pm Thu Jul 2 19:27:03 2009
@@ -1,7 +1,7 @@
use strict;
use warnings;
package Grandchild;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
use base 'Child';
Modified: trunk/libdata-section-perl/t/lib/I/Child.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/I/Child.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/I/Child.pm (original)
+++ trunk/libdata-section-perl/t/lib/I/Child.pm Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/t/lib/I/Grandchild.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/I/Grandchild.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/I/Grandchild.pm (original)
+++ trunk/libdata-section-perl/t/lib/I/Grandchild.pm Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/t/lib/I/Parent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/I/Parent.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/I/Parent.pm (original)
+++ trunk/libdata-section-perl/t/lib/I/Parent.pm Thu Jul 2 19:27:03 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: trunk/libdata-section-perl/t/lib/NoData.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/NoData.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/NoData.pm (original)
+++ trunk/libdata-section-perl/t/lib/NoData.pm Thu Jul 2 19:27:03 2009
@@ -1,7 +1,7 @@
use strict;
use warnings;
package NoData;
-our $VERSION = '0.005';
+our $VERSION = '0.091820';
use Data::Section -setup;
Modified: trunk/libdata-section-perl/t/lib/Parent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-section-perl/t/lib/Parent.pm?rev=39155&op=diff
==============================================================================
--- trunk/libdata-section-perl/t/lib/Parent.pm (original)
+++ trunk/libdata-section-perl/t/lib/Parent.pm Thu Jul 2 19:27:03 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