Pod-Strip-1.02/0000755000175000017500000000000010407604332013166 5ustar dommdomm00000000000000Pod-Strip-1.02/t/0000755000175000017500000000000010407604332013431 5ustar dommdomm00000000000000Pod-Strip-1.02/t/99_pod.t0000644000175000017500000000021410407604332014716 0ustar dommdomm00000000000000#!perl -T use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); Pod-Strip-1.02/t/11_replace_with_comments.t0000644000175000017500000000132010407604332020466 0ustar dommdomm00000000000000use Test::More tests => 2; use Pod::Strip; { my $code=<<'EOCODE'; #!/usr/bin/perl =pod the great hello world script including lots of POD =cut # print it print "Hello, world!\n"; exit "done"; =pod more pod =cut EOCODE my $podless; my $p=Pod::Strip->new; $p->replace_with_comments(1); is($p->replace_with_comments(),1); $p->output_string(\$podless); $p->parse_string_document($code); is ($podless, '#!/usr/bin/perl # stripped POD # stripped POD # stripped POD # stripped POD # stripped POD # stripped POD # stripped POD # print it print "Hello, world!\n"; exit "done"; # stripped POD # stripped POD # stripped POD # stripped POD # stripped POD ','pod stripped'); } Pod-Strip-1.02/t/99_pod_coverage.t0000644000175000017500000000025410407604332016575 0ustar dommdomm00000000000000#!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); Pod-Strip-1.02/t/00_load.t0000644000175000017500000000007710407604332015040 0ustar dommdomm00000000000000use Test::More tests => 1; BEGIN { use_ok( 'Pod::Strip' ); } Pod-Strip-1.02/t/10_strip.t0000644000175000017500000000113310407604332015255 0ustar dommdomm00000000000000use Test::More tests => 4; use Pod::Strip; { my $code=<<'EOCODE'; =pod the great hello world script =cut # print it print "Hello, world!\n"; EOCODE my $podless; my $p=Pod::Strip->new; $p->output_string(\$podless); $p->parse_string_document($code); is ($podless,' # print it print "Hello, world!\n"; ','pod stripped'); } { my $podless; my $p=Pod::Strip->new; $p->output_string(\$podless); $p->parse_file('lib/Pod/Strip.pm'); unlike($podless,qr/Thomas Klausner/i); unlike($podless,qr/Synopsos/i); unlike($podless,qr/a new parser object/i); } Pod-Strip-1.02/META.yml0000644000175000017500000000043610407604332014442 0ustar dommdomm00000000000000--- name: Pod-Strip version: 1.02 author: - 'Thomas Klausner ' abstract: Remove POD from Perl code license: perl requires: Pod::Simple: 3.00 Test::More: 0 provides: Pod::Strip: file: lib/Pod/Strip.pm version: 1.02 generated_by: Module::Build version 0.2611 Pod-Strip-1.02/Changes0000644000175000017500000000157110407604332014465 0ustar dommdomm00000000000000#----------------------------------------------------------------- # Changes for Pod::Strip # $Rev: 17 $ # $Date: 2006-03-20 21:18:35 +0100 (Mon, 20 Mar 2006) $ #----------------------------------------------------------------- 1.02 2006-03-20 - changed to 'traditional' Makefile.PL creation (easier install) (suggested by Alexandre Masselot ) - clarified and updated some docs 1.01 2005-11-07 - removed typo in docs (RT #15392 reported by schubiger@cpan.org) 1.00 2004-10-05 - first release to CPAN - added license to Build.PL - some more changes in Build.PL 0.02 2004-09-30 - added replace_with_comments, based on patches submitted by John McNamara 0.01 2004-04-29 - updated docs, tests, MANIFEST, etc 0.00 2004-09-28 - initial version, done with Module::Starter and some manual tweaking Pod-Strip-1.02/lib/0000755000175000017500000000000010407604332013734 5ustar dommdomm00000000000000Pod-Strip-1.02/lib/Pod/0000755000175000017500000000000010407604332014456 5ustar dommdomm00000000000000Pod-Strip-1.02/lib/Pod/Strip.pm0000644000175000017500000000424010407604332016115 0ustar dommdomm00000000000000package Pod::Strip; use warnings; use strict; use base ('Pod::Simple'); our $VERSION = "1.02"; sub new { my $new = shift->SUPER::new(@_); $new->{_code_line}=0; $new->code_handler( sub { # Add optional line directives if ($_[2]->{_replace_with_comments}) { if ($_[2]->{_code_line}+1<$_[1]) { print {$_[2]{output_fh}} ("# stripped POD\n") x ($_[1] - $_[2]->{_code_line} -1 ); } $_[2]->{_code_line}=$_[1]; } print {$_[2]{output_fh}} $_[0],"\n"; return; }); return $new; } sub replace_with_comments { my $self = shift; $self->{_replace_with_comments} = defined $_[0] ? $_[0] : 1; } 1; __END__ =pod =head1 NAME Pod::Strip - Remove POD from Perl code =head1 SYNOPSIS use Pod::Strip; my $p=Pod::Strip->new; # create parser my $podless; # set output string $p->output_string(\$podless); # see Pod::Simple $p->parse_string_document($code); # or some other parsing method # from Pod::Simple # $podless will now contain code without any POD =head1 DESCRIPTION Pod::Strip is a subclass of Pod::Simple that strips all POD from Perl Code. =head1 METHODS All methods besides those listed here are inherited from Pod::Simple =head2 new Generate a new parser object. =head2 replace_with_comments Call this method with a true argument to replace POD with comments (looking like "# stripped POD") instead of stripping it. This has the effect that line numbers get reported correctly in error messages etc. =head1 AUTHOR Thomas Klausner, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 COPYRIGHT & LICENSE Copyright 2004, 2005, 2006 Thomas Klausner, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Pod-Strip-1.02/MANIFEST0000644000175000017500000000030410407604332014314 0ustar dommdomm00000000000000Build.PL Changes lib/Pod/Strip.pm Makefile.PL MANIFEST META.yml # Will be created by "make dist" README t/00_load.t t/10_strip.t t/11_replace_with_comments.t t/99_pod.t t/99_pod_coverage.t TODO Pod-Strip-1.02/TODO0000644000175000017500000000032610407604332013657 0ustar dommdomm00000000000000#----------------------------------------------------------------- # TODO # $Rev: 15 $ # $Date: 2005-11-07 10:32:24 +0100 (Mon, 07 Nov 2005) $ #----------------------------------------------------------------- Pod-Strip-1.02/Build.PL0000644000175000017500000000073110407604332014463 0ustar dommdomm00000000000000use strict; use warnings; use Module::Build; my $builder = Module::Build->new( module_name => 'Pod::Strip', license => 'perl', dist_author => 'Thomas Klausner ', dist_version_from => 'lib/Pod/Strip.pm', requires => { 'Test::More' => 0, 'Pod::Simple' => '3.00', }, add_to_cleanup => [ 'Pod-Strip-*' ], create_makefile_pl => 'traditional', ); $builder->create_build_script(); Pod-Strip-1.02/Makefile.PL0000644000175000017500000000065210407604332015143 0ustar dommdomm00000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.03 use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'Pod::Strip', 'VERSION_FROM' => 'lib/Pod/Strip.pm', 'PREREQ_PM' => { 'Pod::Simple' => '3.00', 'Test::More' => '0' }, 'INSTALLDIRS' => 'site', 'PL_FILES' => {} ) ; Pod-Strip-1.02/README0000644000175000017500000000066310407604332014053 0ustar dommdomm00000000000000Pod::Strip - Remove POD from Perl code Pod::Strip is a subclass of Pod::Simple that strips all POD from Perl Code. INSTALLATION To install this module, run the following commands: perl Build.PL ./Build ./Build test ./Build install COPYRIGHT AND LICENCE Copyright (C) 2004,2005,2006 Thomas Klausner, ZSI This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.