diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2012-03-04 20:55:48 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2012-03-04 20:55:48 +0000 |
commit | 9d57faa691260c0dc94a0d8a08ab8935ccf9905a (patch) | |
tree | 2898b0da44c0229ab8d72f93291ce9c898b6cc75 | |
parent | 920e47bbc431efd5c1ca9d8b85fb88c172326b14 (diff) | |
download | perl-smoke-me/modcorelist-pod.tar.gz |
Separate the POD from the corelist data in Module::CoreListsmoke-me/modcorelist-pod
See https://github.com/CPAN-API/metacpan-web/issues/485
-rw-r--r-- | MANIFEST | 1 | ||||
-rwxr-xr-x | Porting/corelist.pl | 23 | ||||
-rw-r--r-- | dist/Module-CoreList/MANIFEST | 1 | ||||
-rw-r--r-- | dist/Module-CoreList/lib/Module/CoreList.pm | 193 | ||||
-rw-r--r-- | dist/Module-CoreList/lib/Module/CoreList.pod | 192 |
5 files changed, 209 insertions, 201 deletions
@@ -3380,6 +3380,7 @@ dist/Module-CoreList/Changes Module::CoreList Changes dist/Module-CoreList/corelist The corelist command-line utility dist/Module-CoreList/identify-dependencies A usage example for Module::CoreList dist/Module-CoreList/lib/Module/CoreList.pm Module::CoreList +dist/Module-CoreList/lib/Module/CoreList.pod Module::CoreList dist/Module-CoreList/Makefile.PL Module::CoreList dist/Module-CoreList/MANIFEST Module::CoreList dist/Module-CoreList/README Module::CoreList diff --git a/Porting/corelist.pl b/Porting/corelist.pl index ead044b6a2..83211f3311 100755 --- a/Porting/corelist.pl +++ b/Porting/corelist.pl @@ -22,6 +22,7 @@ use HTTP::Tiny; use IO::Uncompress::Gunzip; my $corelist_file = 'dist/Module-CoreList/lib/Module/CoreList.pm'; +my $pod_file = 'dist/Module-CoreList/lib/Module/CoreList.pod'; my %lines; my %module_to_file; @@ -234,11 +235,6 @@ $tracker .= ");"; $corelist =~ s/^%bug_tracker .*? ;/$tracker/eismx; -unless ( $corelist =~ /and $perl_vstring releases of perl/ ) { - warn "Adding $perl_vstring to the list of perl versions covered by Module::CoreList\n"; - $corelist =~ s/(currently covers (?:.*?))\s*and (.*?) releases of perl/$1, $2 and $perl_vstring releases of perl/ism; -} - unless ( $corelist =~ /^%released \s* = \s* \( .*? @@ -251,14 +247,25 @@ unless ( /$1 $perl_vnum => '????-??-??',\n $2/ismx; } -write_corelist($corelist); +write_corelist($corelist,$corelist_file); + +open( my $pod_fh, '<', $pod_file ); +my $pod = join( '', <$pod_fh> ); + +unless ( $pod =~ /and $perl_vstring releases of perl/ ) { + warn "Adding $perl_vstring to the list of perl versions covered by Module::CoreList\n"; + $pod =~ s/(currently covers (?:.*?))\s*and (.*?) releases of perl/$1, $2 and $perl_vstring releases of perl/ism; +} + +write_corelist($pod,$pod_file); -warn "All done. Please check over $corelist_file carefully before committing. Thanks!\n"; +warn "All done. Please check over $corelist_file and $pod_file carefully before committing. Thanks!\n"; sub write_corelist { my $content = shift; - open (my $clfh, ">", $corelist_file); + my $filename = shift; + open (my $clfh, ">", $filename); print $clfh $content; close($clfh); } diff --git a/dist/Module-CoreList/MANIFEST b/dist/Module-CoreList/MANIFEST index b5105a7f3d..e9a9ca7b41 100644 --- a/dist/Module-CoreList/MANIFEST +++ b/dist/Module-CoreList/MANIFEST @@ -2,6 +2,7 @@ Changes corelist identify-dependencies lib/Module/CoreList.pm +lib/Module/CoreList.pod README MANIFEST Makefile.PL diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm index ea3c3addb6..4f1fa8315b 100644 --- a/dist/Module-CoreList/lib/Module/CoreList.pm +++ b/dist/Module-CoreList/lib/Module/CoreList.pm @@ -4,199 +4,6 @@ use vars qw/$VERSION %released %version %families %upstream %bug_tracker %deprecated/; $VERSION = '2.61'; -=head1 NAME - -Module::CoreList - what modules shipped with versions of perl - -=head1 SYNOPSIS - - use Module::CoreList; - - print $Module::CoreList::version{5.00503}{CPAN}; # prints 1.48 - - print Module::CoreList->first_release('File::Spec'); # prints 5.00405 - print Module::CoreList->first_release_by_date('File::Spec'); # prints 5.005 - print Module::CoreList->first_release('File::Spec', 0.82); # prints 5.006001 - - print join ', ', Module::CoreList->find_modules(qr/Data/); - # prints 'Data::Dumper' - print join ', ', Module::CoreList->find_modules(qr/test::h.*::.*s/i, 5.008008); - # prints 'Test::Harness::Assert, Test::Harness::Straps' - - print join ", ", @{ $Module::CoreList::families{5.005} }; - # prints "5.005, 5.00503, 5.00504" - -=head1 DESCRIPTION - -Module::CoreList provides information on which core and dual-life modules shipped -with each version of L<perl>. - -It provides a number of mechanisms for querying this information. - -There is a utility called L<corelist> provided with this module -which is a convenient way of querying from the command-line. - -There is a functional programming API available for programmers to query -information. - -Programmers may also query the contained hash structures to find relevant -information. - -=head1 FUNCTIONS API - -These are the functions that are available, they may either be called as functions or class methods: - - Module::CoreList::first_release('File::Spec'); # as a function - - Module::CoreList->first_release('File::Spec'); # class method - -=over - -=item C<first_release( MODULE )> - -Behaviour since version 2.11 - -Requires a MODULE name as an argument, returns the perl version when that module first -appeared in core as ordered by perl version number or undef ( in scalar context ) -or an empty list ( in list context ) if that module is not in core. - -=item C<first_release_by_date( MODULE )> - -Requires a MODULE name as an argument, returns the perl version when that module first -appeared in core as ordered by release date or undef ( in scalar context ) -or an empty list ( in list context ) if that module is not in core. - -=item C<find_modules( REGEX, [ LIST OF PERLS ] )> - -Takes a regex as an argument, returns a list of modules that match the regex given. -If only a regex is provided applies to all modules in all perl versions. Optionally -you may provide a list of perl versions to limit the regex search. - -=item C<find_version( PERL_VERSION )> - -Takes a perl version as an argument. Returns that perl version if it exists or C<undef> -otherwise. - -=item C<is_deprecated( MODULE, PERL_VERSION )> - -Available in version 2.22 and above. - -Returns true if MODULE is marked as deprecated in PERL_VERSION. If PERL_VERSION is -omitted, it defaults to the current version of Perl. - -=item C<removed_from( MODULE )> - -Available in version 2.32 and above - -Takes a module name as an argument, returns the first perl version where that module -was removed from core. Returns undef if the given module was never in core or remains -in core. - -=item C<removed_from_by_date( MODULE )> - -Available in version 2.32 and above - -Takes a module name as an argument, returns the first perl version by release date where that module -was removed from core. Returns undef if the given module was never in core or remains -in core. - -=back - -=head1 DATA STRUCTURES - -These are the hash data structures that are available: - -=over - -=item C<%Module::CoreList::version> - -A hash of hashes that is keyed on perl version as indicated -in $]. The second level hash is module => version pairs. - -Note, it is possible for the version of a module to be unspecified, -whereby the value is C<undef>, so use C<exists $version{$foo}{$bar}> if -that's what you're testing for. - -Starting with 2.10, the special module name C<Unicode> refers to the version of -the Unicode Character Database bundled with Perl. - -=item C<%Module::CoreList::released> - -Keyed on perl version this contains ISO -formatted versions of the release dates, as gleaned from L<perlhist>. - -=item C<%Module::CoreList::families> - -New, in 1.96, a hash that -clusters known perl releases by their major versions. - -=item C<%Module::CoreList::deprecated> - -A hash of hashes keyed on perl version and on module name. -If a module is defined it indicates that that module is -deprecated in that perl version and is scheduled for removal -from core at some future point. - -=item C<%Module::CoreList::upstream> - -A hash that contains information on where patches should be directed -for each core module. - -UPSTREAM indicates where patches should go. C<undef> implies -that this hasn't been discussed for the module at hand. -C<blead> indicates that the copy of the module in the blead -sources is to be considered canonical, C<cpan> means that the -module on CPAN is to be patched first. C<first-come> means -that blead can be patched freely if it is in sync with the -latest release on CPAN. - -=item C<%Module::CoreList::bug_tracker> - -A hash that contains information on the appropriate bug tracker -for each core module. - -BUGS is an email or url to post bug reports. For modules with -UPSTREAM => 'blead', use perl5-porters@perl.org. rt.cpan.org -appears to automatically provide a URL for CPAN modules; any value -given here overrides the default: -http://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName - -=back - -=head1 CAVEATS - -Module::CoreList currently covers the 5.000, 5.001, 5.002, 5.003_07, -5.004, 5.004_05, 5.005, 5.005_03, 5.005_04, 5.6.0, 5.6.1, 5.6.2, 5.7.3, -5.8.0, 5.8.1, 5.8.2, 5.8.3, 5.8.4, 5.8.5, 5.8.6, 5.8.7, 5.8.8, 5.8.9, -5.9.0, 5.9.1, 5.9.2, 5.9.3, 5.9.4, 5.9.5, 5.10.0, 5.10.1, 5.11.0, 5.11.1, -5.11.2, 5.11.3, 5.11.4, 5.11.5, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, -5.13.0, 5.13.1, 5.13.2, 5.13.3, 5.13.4, 5.13.5, 5.13.6, 5.13.7, 5.13.8, -5.13.9, 5.13.10, 5.13.11, 5.14.0, 5.14.1, 5.14.2, 5.15.0, 5.15.1, 5.15.2, -5.15.3, 5.15.4, 5.15.5, 5.15.6, 5.15.7 and 5.15.8 releases of perl. - -=head1 HISTORY - -Moved to Changes file. - -=head1 AUTHOR - -Richard Clamp E<lt>richardc@unixbeard.netE<gt> - -Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>. - -=head1 LICENSE - -Copyright (C) 2002-2009 Richard Clamp. All Rights Reserved. - -This module is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -=head1 SEE ALSO - -L<corelist>, L<Module::Info>, L<perl>, L<http://perlpunks.de/corelist> - -=cut - my $dumpinc = 0; sub import { my $self = shift; diff --git a/dist/Module-CoreList/lib/Module/CoreList.pod b/dist/Module-CoreList/lib/Module/CoreList.pod new file mode 100644 index 0000000000..dcb9c91bd7 --- /dev/null +++ b/dist/Module-CoreList/lib/Module/CoreList.pod @@ -0,0 +1,192 @@ +=head1 NAME + +Module::CoreList - what modules shipped with versions of perl + +=head1 SYNOPSIS + + use Module::CoreList; + + print $Module::CoreList::version{5.00503}{CPAN}; # prints 1.48 + + print Module::CoreList->first_release('File::Spec'); # prints 5.00405 + print Module::CoreList->first_release_by_date('File::Spec'); # prints 5.005 + print Module::CoreList->first_release('File::Spec', 0.82); # prints 5.006001 + + print join ', ', Module::CoreList->find_modules(qr/Data/); + # prints 'Data::Dumper' + print join ', ', Module::CoreList->find_modules(qr/test::h.*::.*s/i, 5.008008); + # prints 'Test::Harness::Assert, Test::Harness::Straps' + + print join ", ", @{ $Module::CoreList::families{5.005} }; + # prints "5.005, 5.00503, 5.00504" + +=head1 DESCRIPTION + +Module::CoreList provides information on which core and dual-life modules shipped +with each version of L<perl>. + +It provides a number of mechanisms for querying this information. + +There is a utility called L<corelist> provided with this module +which is a convenient way of querying from the command-line. + +There is a functional programming API available for programmers to query +information. + +Programmers may also query the contained hash structures to find relevant +information. + +=head1 FUNCTIONS API + +These are the functions that are available, they may either be called as functions or class methods: + + Module::CoreList::first_release('File::Spec'); # as a function + + Module::CoreList->first_release('File::Spec'); # class method + +=over + +=item C<first_release( MODULE )> + +Behaviour since version 2.11 + +Requires a MODULE name as an argument, returns the perl version when that module first +appeared in core as ordered by perl version number or undef ( in scalar context ) +or an empty list ( in list context ) if that module is not in core. + +=item C<first_release_by_date( MODULE )> + +Requires a MODULE name as an argument, returns the perl version when that module first +appeared in core as ordered by release date or undef ( in scalar context ) +or an empty list ( in list context ) if that module is not in core. + +=item C<find_modules( REGEX, [ LIST OF PERLS ] )> + +Takes a regex as an argument, returns a list of modules that match the regex given. +If only a regex is provided applies to all modules in all perl versions. Optionally +you may provide a list of perl versions to limit the regex search. + +=item C<find_version( PERL_VERSION )> + +Takes a perl version as an argument. Returns that perl version if it exists or C<undef> +otherwise. + +=item C<is_deprecated( MODULE, PERL_VERSION )> + +Available in version 2.22 and above. + +Returns true if MODULE is marked as deprecated in PERL_VERSION. If PERL_VERSION is +omitted, it defaults to the current version of Perl. + +=item C<removed_from( MODULE )> + +Available in version 2.32 and above + +Takes a module name as an argument, returns the first perl version where that module +was removed from core. Returns undef if the given module was never in core or remains +in core. + +=item C<removed_from_by_date( MODULE )> + +Available in version 2.32 and above + +Takes a module name as an argument, returns the first perl version by release date where that module +was removed from core. Returns undef if the given module was never in core or remains +in core. + +=back + +=head1 DATA STRUCTURES + +These are the hash data structures that are available: + +=over + +=item C<%Module::CoreList::version> + +A hash of hashes that is keyed on perl version as indicated +in $]. The second level hash is module => version pairs. + +Note, it is possible for the version of a module to be unspecified, +whereby the value is C<undef>, so use C<exists $version{$foo}{$bar}> if +that's what you're testing for. + +Starting with 2.10, the special module name C<Unicode> refers to the version of +the Unicode Character Database bundled with Perl. + +=item C<%Module::CoreList::released> + +Keyed on perl version this contains ISO +formatted versions of the release dates, as gleaned from L<perlhist>. + +=item C<%Module::CoreList::families> + +New, in 1.96, a hash that +clusters known perl releases by their major versions. + +=item C<%Module::CoreList::deprecated> + +A hash of hashes keyed on perl version and on module name. +If a module is defined it indicates that that module is +deprecated in that perl version and is scheduled for removal +from core at some future point. + +=item C<%Module::CoreList::upstream> + +A hash that contains information on where patches should be directed +for each core module. + +UPSTREAM indicates where patches should go. C<undef> implies +that this hasn't been discussed for the module at hand. +C<blead> indicates that the copy of the module in the blead +sources is to be considered canonical, C<cpan> means that the +module on CPAN is to be patched first. C<first-come> means +that blead can be patched freely if it is in sync with the +latest release on CPAN. + +=item C<%Module::CoreList::bug_tracker> + +A hash that contains information on the appropriate bug tracker +for each core module. + +BUGS is an email or url to post bug reports. For modules with +UPSTREAM => 'blead', use perl5-porters@perl.org. rt.cpan.org +appears to automatically provide a URL for CPAN modules; any value +given here overrides the default: +http://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName + +=back + +=head1 CAVEATS + +Module::CoreList currently covers the 5.000, 5.001, 5.002, 5.003_07, +5.004, 5.004_05, 5.005, 5.005_03, 5.005_04, 5.6.0, 5.6.1, 5.6.2, 5.7.3, +5.8.0, 5.8.1, 5.8.2, 5.8.3, 5.8.4, 5.8.5, 5.8.6, 5.8.7, 5.8.8, 5.8.9, +5.9.0, 5.9.1, 5.9.2, 5.9.3, 5.9.4, 5.9.5, 5.10.0, 5.10.1, 5.11.0, 5.11.1, +5.11.2, 5.11.3, 5.11.4, 5.11.5, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, +5.13.0, 5.13.1, 5.13.2, 5.13.3, 5.13.4, 5.13.5, 5.13.6, 5.13.7, 5.13.8, +5.13.9, 5.13.10, 5.13.11, 5.14.0, 5.14.1, 5.14.2, 5.15.0, 5.15.1, 5.15.2, +5.15.3, 5.15.4, 5.15.5, 5.15.6, 5.15.7 and 5.15.8 releases of perl. + +=head1 HISTORY + +Moved to Changes file. + +=head1 AUTHOR + +Richard Clamp E<lt>richardc@unixbeard.netE<gt> + +Currently maintained by the perl 5 porters E<lt>perl5-porters@perl.orgE<gt>. + +=head1 LICENSE + +Copyright (C) 2002-2009 Richard Clamp. All Rights Reserved. + +This module is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=head1 SEE ALSO + +L<corelist>, L<Module::Info>, L<perl>, L<http://perlpunks.de/corelist> + +=cut |