From: Karen Etheridge Date: Sat, 26 Jul 2014 21:55:02 +0000 (-0700) Subject: allow customizing what happens to README, for Catalyst-Manual X-Git-Tag: v0.002000~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e83c1136942e90f596d884aa51220afb76213ba;p=p5sagit%2FDistar.git allow customizing what happens to README, for Catalyst-Manual --- diff --git a/lib/Distar.pm b/lib/Distar.pm index 1b39711..0fa8961 100644 --- a/lib/Distar.pm +++ b/lib/Distar.pm @@ -15,7 +15,7 @@ $VERSION = eval $VERSION; my $MM_VER = eval $ExtUtils::MakeMaker::VERSION; our @EXPORT = qw( - author manifest_include run_preflight + author manifest_include readme_generator run_preflight ); sub import { @@ -48,6 +48,14 @@ sub manifest_include { push @Manifest, @_; } +my $readme_generator = <$(DISTVNAME)/README + $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) ../Distar/helpers/add-readme-to-manifest +README +sub readme_generator { + $readme_generator = shift; +} + sub write_manifest_skip { my @files = @Manifest; my @parts; @@ -134,7 +142,7 @@ sub run_preflight { sub dist_test { my $self = shift; - my $dist_test = $self->SUPER::dist_test(@_) . <<'END'; + my $dist_test = $self->SUPER::dist_test(@_) . <<'END' # --- Distar section: preflight: @@ -149,8 +157,8 @@ release: preflight git push origin v$(VERSION) HEAD distdir: readmefile readmefile: create_distdir - pod2text $(VERSION_FROM) >$(DISTVNAME)/README - $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) ../Distar/helpers/add-readme-to-manifest +END + . $readme_generator . <<'END'; disttest: distmanicheck distmanicheck: create_distdir cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck"