From: Peter Rabbitson Date: Sun, 9 Dec 2012 13:38:26 +0000 (+0100) Subject: Move generated POD to its own dir X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47589465c9677bec08eff05300ec921d91ad25d2;hp=40112a8a79e08de519d0a68d50af800e6495db20;p=dbsrgits%2FDBIx-Class-Historic.git Move generated POD to its own dir --- diff --git a/.generated_pod/.git_placeholder b/.generated_pod/.git_placeholder new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore index 7743e57..fb5c204 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ Makefile.old _build/ blib/ inc/ -lib/DBIx/Class/Optional/Dependencies.pod DBIx-Class-*/ DBIx-Class-*.tar.* pm_to_blib @@ -18,3 +17,4 @@ t/var/ *# .#* *~ +.generated_pod/* diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index f6c1759..207b17d 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -1,4 +1,4 @@ -^(?!script/|examples/|lib/|inc/|t/|xt/|Makefile\.PL$|maint/|README$|MANIFEST$|Changes$|META\.(?:yml|json)$) +^(?!script/|examples/|lib/|inc/|t/|xt/|Makefile\.PL$|maint/|.generated_pod/|README$|MANIFEST$|Changes$|META\.(?:yml|json)$) # Avoid version control files. \bRCS\b diff --git a/Makefile.PL b/Makefile.PL index ab2bc94..59373d1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -14,6 +14,13 @@ BEGIN { $Module::Install::AUTHOR = 0 if (grep { $ENV{"PERL5_${_}_IS_RUNNING"} } (qw/CPANM CPANPLUS CPAN/) ); } +homepage 'http://www.dbix-class.org/'; +resources 'IRC' => 'irc://irc.perl.org/#dbix-class'; +resources 'license' => 'http://dev.perl.org/licenses/'; +resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class'; +resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class'; +resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class'; + name 'DBIx-Class'; perl_version '5.008001'; all_from 'lib/DBIx/Class.pm'; @@ -27,12 +34,10 @@ install_script (qw| script/dbicadmin |); -homepage 'http://www.dbix-class.org/'; -resources 'IRC' => 'irc://irc.perl.org/#dbix-class'; -resources 'license' => 'http://dev.perl.org/licenses/'; -resources 'repository' => 'https://github.com/dbsrgits/DBIx-Class'; -resources 'MailingList' => 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class'; -resources 'bugtracker' => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class'; +makemaker_args( + PMLIBDIRS => [qw(lib .generated_pod)], + PMLIBPARENTDIRS => [qw(lib .generated_pod)], +); ### ### DO NOT ADD OPTIONAL DEPENDENCIES HERE, EVEN AS recommends() diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index a507742..b35c3c9 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -698,13 +698,9 @@ sub req_group_list { # This is to be called by the author only (automatically in Makefile.PL) sub _gen_pod { - my ($class, $distver) = @_; + my ($class, $distver, $pod_dir) = @_; - my $modfn = __PACKAGE__ . '.pm'; - $modfn =~ s/\:\:/\//g; - - my $podfn = __FILE__; - $podfn =~ s/\.pm$/\.pod/; + die "No POD root dir supplied" unless $pod_dir; $distver ||= eval { require DBIx::Class; DBIx::Class->VERSION; } @@ -717,6 +713,17 @@ sub _gen_pod { "\n\n---------------------------------------------------------------------\n" ; + # do not ask for a recet version, use 1.x API calls + # this *may* execute on a smoker with old perl or whatnot + require File::Path; + + (my $modfn = __PACKAGE__ . '.pm') =~ s|::|/|g; + + (my $podfn = "$pod_dir/$modfn") =~ s/\.pm$/\.pod/; + (my $dir = $podfn) =~ s|/[^/]+$||; + + File::Path::mkpath([$dir]); + my $sqltver = $class->req_list_for ('deploy')->{'SQL::Translator'} or die "Hrmm? No sqlt dep?"; @@ -864,6 +871,7 @@ EOD open (my $fh, '>', $podfn) or Carp::croak "Unable to write to $podfn: $!"; print $fh join ("\n\n", @chunks); + print $fh "\n"; close ($fh); } diff --git a/maint/Makefile.PL.inc/53_autogen_optdeps_pod.pl b/maint/Makefile.PL.inc/53_autogen_optdeps_pod.pl index 7c33931..21a2bed 100644 --- a/maint/Makefile.PL.inc/53_autogen_optdeps_pod.pl +++ b/maint/Makefile.PL.inc/53_autogen_optdeps_pod.pl @@ -1,9 +1,15 @@ +# leftovers in old checkouts +unlink 'lib/DBIx/Class/Optional/Dependencies.pod' + if -f 'lib/DBIx/Class/Optional/Dependencies.pod'; + +my $pod_dir = '.generated_pod'; + # generate the pod as both a clone-dir step, and a makefile distdir step my $ver = Meta->version; print "Regenerating Optional/Dependencies.pod\n"; require DBIx::Class::Optional::Dependencies; -DBIx::Class::Optional::Dependencies->_gen_pod ($ver); +DBIx::Class::Optional::Dependencies->_gen_pod ($ver, $pod_dir); postamble <<"EOP"; @@ -12,10 +18,9 @@ postamble <<"EOP"; create_distdir : dbic_clonedir_gen_optdeps_pod dbic_clonedir_gen_optdeps_pod : -\t\$(ABSPERL) -Ilib -MDBIx::Class::Optional::Dependencies -e 'DBIx::Class::Optional::Dependencies->_gen_pod($ver)' +\t\$(ABSPERL) -Ilib -MDBIx::Class::Optional::Dependencies -e "DBIx::Class::Optional::Dependencies->_gen_pod(qw($ver $pod_dir))" EOP - # keep the Makefile.PL eval happy 1; diff --git a/xt/eol.t b/xt/eol.t index 221bce4..d5e9d42 100644 --- a/xt/eol.t +++ b/xt/eol.t @@ -14,7 +14,7 @@ unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_eol') ) { } Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, - qw/t xt lib script examples maint/, + qw/t xt lib script examples maint .generated_pod/, ); # Changes is not a "perl file", hence checked separately diff --git a/xt/notabs.t b/xt/notabs.t index 3ddea64..e9ab916 100644 --- a/xt/notabs.t +++ b/xt/notabs.t @@ -14,7 +14,7 @@ unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_notabs') ) { } Test::NoTabs::all_perl_files_ok( - qw/t xt lib script examples maint/, + qw/t xt lib script examples maint .generated_pod/, ); # Changes is not a "perl file", hence checked separately diff --git a/xt/pod.t b/xt/pod.t index 92d650e..93cdb3f 100644 --- a/xt/pod.t +++ b/xt/pod.t @@ -13,4 +13,4 @@ unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_pod') ) { : plan skip_all => "Test needs: $missing" } -Test::Pod::all_pod_files_ok(); +Test::Pod::all_pod_files_ok(qw( .generated_pod lib )); diff --git a/xt/podcoverage.t b/xt/podcoverage.t index a5c923f..71ec4de 100644 --- a/xt/podcoverage.t +++ b/xt/podcoverage.t @@ -3,7 +3,7 @@ use strict; use Test::More; use List::Util 'first'; -use lib qw(t/lib); +use lib qw(t/lib .generated_pod); use DBICTest; use namespace::clean; @@ -159,7 +159,7 @@ for my $string (keys %$exceptions) { $ex_lookup->{$re} = $ex; } -my @modules = sort { $a cmp $b } (Test::Pod::Coverage::all_modules()); +my @modules = sort { $a cmp $b } Test::Pod::Coverage::all_modules('lib'); foreach my $module (@modules) { SKIP: {