rjbs/Dist-Zilla — pull request #349 by neilbowers (2014-08-31 09:03:29+00:00)
Title: Fix situation where ABSTRACT comment is empty

Bizarrely, my first thought on waking up this morning was "Jeez, that \S+ was a boneheaded regexp".

So here's an improved change:

* Added testcase for the problem situation (blank ABSTRACT comment, expect to take abstract from NAME)
* Regexp that works for abstracts that have more than one word :-)
* All tests pass

If you have the following line:
# ABSTRACT:
Then you currently get the next line (following the ABSTRACT comment)
as the abstract.
I think the intention of the code was to not match at this point,
so the abstract would be extracted from the pod

The regexp is now:

/^\s*#+\s*ABSTRACT:[ \t]*(\S.*)$/m

Need to have the `[ \t]`, rather than

ABSTRACT:\s*

Because the \s* was slurping up the newline, causing the rest of the previous
regexp to grab the following line. I'm also assuming that DZ expects a single
line abstract comment, and isn't expected to support:

# ABSTRACT: this is the start of a really long abstract
# that runs across multiple lines

Added a testcase, which failed without the change, and passes with the change.
The rest of the testsuite still passes, which is an improvement on my
previous pull request :-)

I'm not at all familiar with the internals of DZ, so suspect that I didn't
write the test in "the right way", but it works.