Permalink
Browse files

Use DZP::PodWeaver.

  • Loading branch information...
1 parent dbfa4bc commit 1327edf1a6d5be8931ac2b26e76a03fa2864ac58 @yak1ex committed Oct 31, 2012
Showing with 53 additions and 62 deletions.
  1. +2 −0 dist.ini
  2. +3 −21 lib/PPI/Transform/PackageName.pm
  3. +20 −41 lib/filtered.pm
  4. +28 −0 weaver.ini
View
@@ -22,6 +22,8 @@ location = root
[NextRelease]
filename = Changes
+[PodWeaver]
+
[OurPkgVersion]
[CheckVersionIncrement]
[PodSyntaxTests]
@@ -3,6 +3,7 @@ use warnings;
package PPI::Transform::PackageName;
+# ABSTRACT: Subclass of PPI::Transform specific for modifying package names
# VERSION
use base qw(PPI::Transform);
@@ -43,10 +44,6 @@ sub document
__END__
=pod
-=head1 NAME
-
-PPI::Transform::PackageName - Subclass of PPI::Transform specific for modifying package names
-
=head1 SYNOPSIS
use PPI::Transform::PackageName;
@@ -58,31 +55,16 @@ PPI::Transform::PackageName - Subclass of PPI::Transform specific for modifying
This module is a subclass of PPI::Transform specific for modifying package name.
-=head1 OPTIONS
-
-=over 4
-
-=item I<-package_name>
+=option I<-package_name>
Specify code reference called for modifying arguments of C<package> statements.
The code reference is called for each argument.
Original is passed as $_ and it is expected that $_ is modified.
-=item I<-word>
+=option I<-word>
Specify code reference called for modifying bare words other than arguments of C<package> statement.
The code reference is called for each bare word.
Original is passed as $_ and it is expected that $_ is modified.
-=back
-
-=head1 AUTHOR
-
-Yasutaka ATARASHI <yakex@cpan.org>
-
-=head1 LICENSE
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
=cut
View
@@ -1,6 +1,11 @@
use strict;
use warnings;
+package filtered; # for Pod::Weaver
+
+# ABSTRACT: Apply source filter on external module
+# VERSION
+
package filtered::hook; ## no critic (RequireFilenameMatchesPackage)
# VERSION
@@ -114,7 +119,6 @@ sub filtered::hook::INC
package filtered;
-# VERSION
use Carp;
@@ -179,10 +183,6 @@ sub import
__END__
=pod
-=head1 NAME
-
-filtered - Apply source filter on external module
-
=head1 SYNOPSIS
# Apply source filter YourFilter.pm on Target.pm, then result can be used as FilteredTarget
@@ -212,44 +212,40 @@ Source filter has unlimited power to enhance Perl.
However, source filter is usually applied on your own sources.
This module enables you to apply source filter on external module.
-=head1 OPTIONS
-
-Rest of the options are passed to C<import> of filtered module.
-
-=over 4
-
-=item C<by>
+=option C<by>
Mandatory. Specify a source filter module you want to apply on an external module.
-=item C<with>
+=option C<with>
Specify arguments passed to source filter. NOTE that this value is just embedded as a scalar string.
-=item C<as>
+=option C<as>
Specify the package name for the resultant filtered module.
This option can be omitted. If omitted, original names are used.
-=item C<on>
+=option C<on>
Mandatory. Specify a target module. C<on> keyword can be ommited if this is the last option.
-=item C<use_ppi>
+=option C<use_ppi>
If true, L<PPI> is used for replacement by C<as>. If PPI is available, defaults to true. Otherwise false.
-=back
+=option Others
+
+Rest of the options are passed to C<import> of filtered module.
=head1 CAVEATS
-=over 4
+=begin :list
-=item This module uses @INC hook.
+= This module uses @INC hook.
For @INC hook, please consult C<perldoc -f require>. Hook itself is enabled in short period but it may affect other modules.
-=item Replacement by C<as> is applied in limited context.
+= Replacement by C<as> is applied in limited context.
If you specified C<as =E<gt> FilteredTarget, on =E<gt> Target>, the following codes:
@@ -265,29 +261,12 @@ are transformed into as follows:
Actually, only C<'\bpackage\s+Target\b'> and C<'\bTarget::\b'> are replaced if C<use_ppi> is false. C<'\bTarget\b'> in arguments of C<package> statements and bare words are replaced if C<use_ppi> is true.
-=back
+=end :list
=head1 SEE ALSO
-=over 4
-
-=item *
-
-L<http://github.com/yak1ex/filtered> - Github repository
-
-=item *
-
-L<Filter::Simple> - Helper module to implement source filter
-
-=back
-
-=head1 AUTHOR
-
-Yasutaka ATARASHI <yakex@cpan.org>
-
-=head1 LICENSE
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
+=for :list
+* L<http://github.com/yak1ex/filtered> - Github repository
+* L<Filter::Simple> - Helper module to implement source filter
=cut
View
@@ -0,0 +1,28 @@
+[-Transformer]
+transformer = List
+
+[@CorePrep]
+
+[Name]
+[Version]
+
+[Region / prelude]
+
+[Generic / SYNOPSIS]
+[Generic / DESCRIPTION]
+
+[Collect / OPTIONS]
+command = option
+[Collect / ATTRIBUTES]
+command = attr
+[Collect / METHODS]
+command = method
+[Collect / FUNCTIONS]
+command = func
+
+[Leftovers]
+
+[Region / postlude]
+
+[Authors]
+[Legal]

0 comments on commit 1327edf

Please sign in to comment.