Skip Menu |

This queue is for tickets about the Devel-Required CPAN distribution.

Report information
The Basics
Id: 4800
Status: resolved
Priority: 0/
Queue: Devel-Required

People
Owner: Nobody in particular
Requestors: db@kavod.com (no email address)
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Enhancement Patch: User customizable files
Hello Liz, I found your module in your PerlMonks writeup. I use the ABSTRACT_FROM variable instead of the VERSION_FROM variable, and my readme file is auto-generated from a pod file: doc/README.pod. Therefore, I enhanced your module to make it more customizable. Here's an example usage: # # auto-update documentation if needed # $::DEVEL_REQUIRED_MAKEFILE_VARIABLE = 'ABSTRACT_FROM'; @::DEVEL_REQUIRED_DEFAULT_POD_FILES = ( 'doc/README.pod' ); @::DEVEL_REQUIRED_DEFAULT_TEXT_FILES = ( '' ); eval "use Devel::Required"; I hope you like it. -Dan
--- Required.pm.orig 2003-12-31 11:52:57.000000000 -0800 +++ Required.pm 2003-12-31 12:31:31.000000000 -0800 @@ -6,6 +6,20 @@ $VERSION = '0.02'; use strict; +# +# Allow the user to specify where things are. +# +my $MAKEFILE_VARIABLE = $::DEVEL_REQUIRED_MAKEFILE_VARIABLE || 'VERSION_FROM'; +my @DEFAULT_POD_FILES = @::DEVEL_REQUIRED_DEFAULT_POD_FILES; +my @DEFAULT_TEXT_FILES = @::DEVEL_REQUIRED_DEFAULT_TEXT_FILES; +if ( ! @DEFAULT_TEXT_FILES ) { + @DEFAULT_TEXT_FILES = ( 'README' ); +} +#print "MAKEFILE_VARIABLE = $MAKEFILE_VARIABLE\n"; +#print "DEFAULT_POD_FILES = " . join( "\n", @DEFAULT_POD_FILES ) . "\n"; +#print "DEFAULT_TEXT_FILES = " . join( "\n", @DEFAULT_TEXT_FILES ) . "\n"; + + # While we're compiling # Make sure we can redefine without problems # Obtain the subroutine name @@ -24,7 +38,8 @@ # Initialize the hash reference to the module info # Initialize the text to replace - my $pod; + my @pod_files = @DEFAULT_POD_FILES; + my @text_files = @DEFAULT_TEXT_FILES; my $modules; my $text; @@ -37,8 +52,8 @@ while (@_) { my ($key,$value) = (shift,shift); - if ($key eq 'VERSION_FROM') { - $pod = $value; + if ($key eq $MAKEFILE_VARIABLE) { + push @pod_files, $value; } elsif ($key eq 'PREREQ_PM') { $modules = $value; } @@ -53,13 +68,18 @@ if $modules; $text ||= " (none)"; -# Convert the README file if there is one -# Convert the main perl module if there is supposed to be one +# Convert text files, if any (README is default). +# Convert pod files (including the specified in VERSION_FROM, by default) - _convert( 'README',"Required Modules:\n",$text,"\n\n" ) - if -e 'README'; - _convert( $pod,"=head1 REQUIRED MODULES\n","\n$text\n","\n=" ) - if $pod and -e $pod; + foreach my $text_file ( @text_files ) { + _convert( $text_file,"Required Modules:\n",$text,"\n\n" ) + if $text_file and -e $text_file; + } + + foreach my $pod_file ( @pod_files ) { + _convert( $pod_file,"=head1 REQUIRED MODULES\n","\n$text\n","\n=" ) + if $pod_file and -e $pod_file; + } }; } #BEGIN
Date: Thu, 1 Jan 2004 12:04:08 +0100
To: bug-Devel-Required [...] rt.cpan.org, "AdminCc of cpan Ticket #4800": ;
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Subject: Re: [cpan #4800] Enhancement Patch: User customizable files
RT-Send-Cc:
Hello Dave, At 15:40 -0500 12/31/03, via RT wrote: Show quoted text
>This message about Devel-Required was sent to you by DBROWNING ><DBROWNING@cpan.org> via rt.cpan.org > >Full context and any attached attachments can be found at: ><URL: https://rt.cpan.org/Ticket/Display.html?id=4800 > > >I found your module in your PerlMonks writeup. I use the >ABSTRACT_FROM variable instead of the VERSION_FROM variable, and my >readme file is auto-generated from a pod file: doc/README.pod. >Therefore, I enhanced your module to make it more customizable. > >Here's an example usage: > ># ># auto-update documentation if needed ># >$::DEVEL_REQUIRED_MAKEFILE_VARIABLE = 'ABSTRACT_FROM'; >@::DEVEL_REQUIRED_DEFAULT_POD_FILES = ( 'doc/README.pod' ); >@::DEVEL_REQUIRED_DEFAULT_TEXT_FILES = ( '' ); >eval "use Devel::Required"; > >I hope you like it.
Seems like there is something missing... I can't seem to find any attachment... Is that correct? Liz
Date: Thu, 1 Jan 2004 12:12:17 +0100
To: bug-Devel-Required [...] rt.cpan.org, "AdminCc of cpan Ticket #4800": ;
From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
Subject: Re: [cpan #4800] Enhancement Patch: User customizable files
RT-Send-Cc:
Hello Dave, At 15:40 -0500 12/31/03, via RT wrote: Show quoted text
>I hope you like it.
I should have looked further... found the attachment on rt.cpan.org, I just needed to scroll my window to the right... ;-) I think the idea is good, but I don't like interface. I was more thinking along the lines of: eval "use Devel::Required pod => 'filename.pod', text => 'textfile'" where this will override the defaults PREREQ_PM and "README". That is, if you're specifying a "pod" setting, you will have to list _all_ files that should have their pod altered. And if you specify a "text" setting, then you will have to specify "README" as well. Does that make sense? Liz