Permalink
Browse files

fix up wikidoc and generated README

  • Loading branch information...
1 parent 177abbe commit 3de5a164324584284d8665b2c8bc52b875784907 @xdg xdg committed Apr 11, 2012
Showing with 50 additions and 57 deletions.
  1. +1 −2 README.pod
  2. +1 −2 lib/Dist/Zilla/Plugin/CheckChangesHasContent.pm
  3. +48 −53 lib/Dist/Zilla/Plugin/Test/ChangesHasContent.pm
View
@@ -20,8 +20,7 @@ This is a "before release" Dist::Zilla plugin that ensures that your Changes
file actually has some content since the last release. If it doesn't find any,
it will abort the release process.
-This can be contrasted to
-LE<lt>[Test::ChangesHasContent]E<verbar>Dist::Zilla::Plugin::Test::ChangesHasContentE<gt>, which
+This can be contrasted to L<Dist::Zilla::Plugin::Test::ChangesHasContent>, which
generates a test to perform the check.
The algorithm is very naive. It looks for an unindented line starting with
@@ -89,8 +89,7 @@ This is a "before release" Dist::Zilla plugin that ensures that your Changes
file actually has some content since the last release. If it doesn't find any,
it will abort the release process.
-This can be contrasted to
-L<[Test::ChangesHasContent]|Dist::Zilla::Plugin::Test::ChangesHasContent>, which
+This can be contrasted to [Dist::Zilla::Plugin::Test::ChangesHasContent], which
generates a test to perform the check.
The algorithm is very naive. It looks for an unindented line starting with
@@ -42,49 +42,7 @@ __PACKAGE__->meta->make_immutable;
1;
-__DATA__
-___[ xt/release/changes_has_content.t ]___
-#!perl
-
-use Test::More tests => 2;
-
-note 'Checking Changes';
-my $changes_file = '{{$changelog}}';
-my $newver = '{{$newver}}';
-
-SKIP: {
- ok(-e $changes_file, "$changes_file file exists")
- or skip 'Changes is missing', 1;
-
- ok(_get_changes($newver), "$changes_file has content for $newver");
-}
-
-done_testing;
-
-# _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit
-# by Jerome Quelin
-sub _get_changes
-{
- my $newver = shift;
-
- # parse changelog to find commit message
- open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!";
- my $changelog = join('', <$fh>);
- close $fh;
-
- my @content =
- grep { /^$newver(?:\s+|$)/ ... /^\S/ } # from newver to un-indented
- split /\n/, $changelog;
- shift @content; # drop the version line
-
- # drop unindented last line and trailing blank lines
- pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ );
-
- # return number of non-blank lines
- return scalar @content;
-}
-
-__END__
+# Pod must be before DATA
=begin wikidoc
@@ -96,21 +54,14 @@ __END__
= DESCRIPTION
-This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the following file:
-
-=over 4
-
-=item *
+This is an extension of [Dist::Zilla::Plugin::InlineFiles], providing the following file:
-xt/release/changes_has_content.t
-
-=back
+* xt/release/changes_has_content.t
This test ensures ensures that your Changes file actually has some content
since the last release.
-This can be contrasted to
-L<[CheckChangesHasContent]|Dist::Zilla::Plugin::CheckChangesHasContent>, which
+This can be contrasted to [Dist::Zilla::Plugin::CheckChangesHasContent], which
performs the check at release time, halting the release process if content is
missing. Performing the check as a test makes it possible to check more
frequently, and closer to the point of development.
@@ -149,3 +100,47 @@ the name with the {changelog} argument:
=cut
+__DATA__
+___[ xt/release/changes_has_content.t ]___
+#!perl
+
+use Test::More tests => 2;
+
+note 'Checking Changes';
+my $changes_file = '{{$changelog}}';
+my $newver = '{{$newver}}';
+
+SKIP: {
+ ok(-e $changes_file, "$changes_file file exists")
+ or skip 'Changes is missing', 1;
+
+ ok(_get_changes($newver), "$changes_file has content for $newver");
+}
+
+done_testing;
+
+# _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit
+# by Jerome Quelin
+sub _get_changes
+{
+ my $newver = shift;
+
+ # parse changelog to find commit message
+ open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!";
+ my $changelog = join('', <$fh>);
+ close $fh;
+
+ my @content =
+ grep { /^$newver(?:\s+|$)/ ... /^\S/ } # from newver to un-indented
+ split /\n/, $changelog;
+ shift @content; # drop the version line
+
+ # drop unindented last line and trailing blank lines
+ pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ );
+
+ # return number of non-blank lines
+ return scalar @content;
+}
+
+__END__
+

0 comments on commit 3de5a16

Please sign in to comment.