xenoterracide/Dist-Zilla-Plugin-Test-PodSpelling — Issue #5: Dash in copyright_holder crashes the plugin
Author: heikkil
Created: 2012-02-29 10:04:21+00:00
State: open

A colleague of mine spotted that this plugin crashes the dzil test run. In his case, there was a dash separated by spaces on both sides in the copyright_holder line of dist.ini. The attached patch fixes it for that particular string by ignoring the non-words. Alternatively, you could change the split patter ' ', into a proper regexp /s+/.

Of course, there might be other places where same check needs to be added, but you know your code better and find them easier.

Yours,

-Heikki
---
lib/Dist/Zilla/Plugin/Test/PodSpelling.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm b/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm
index a8d89da..add4bed 100644
--- a/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm
+++ b/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm
@@ -57,7 +57,7 @@ around add_file => sub {
if ( $self->zilla->copyright_holder ) {
for ( split( ' ', $self->zilla->copyright_holder ) ) {
my ( $word ) = $_ =~ /(\w+)/xms;
-
+ next unless $word;
$self->log_debug( 'copyright_holder word: ' . $word );

$self->push_stopwords( $word );
--
1.7.5.4