make test の時に pod ドキュメントのしペルチェックをしてくれるツール. 前ちょっと試したときに動かなくてほっぽってたけどまたトライ. でもやっぱりうまくうごかせず;; でも miyagawa さんや tokuhirom さんに教わって動作成功♪
うちの環境だと spell がないから set_spell_cmd("ispell") とかしてたのですけれど, aspell だと set_spell_cmd("aspell list"), ispell だと set_spell_cmd("ispell -l") で動く模様. pod にあった aspell -l はうちのとこではだめした. うちのの完成版をさらしてみます〜.
stopwords (例外語句) は, pod のなかで =for stopwords plok Pringe zorch とかかけます. Pod::Spell 参照.
そうそう, yml が stopwords 指定効かなくて悩んでたら, META.yml がひっかかってたぽく. 単語の切り方がツールによってちょっとちがったりするのかも?
#! /usr/bin/perl
# t/97_podspell.t
use strict;
use warnings;
use Test::More;
eval q{ use Test::Spelling };
plan skip_all => "Test::Spelling is not installed." if $@;
my $spell_cmd;
foreach my $path (split(/:/, $ENV{PATH}))
{
-x "$path/spell" and $spell_cmd="spell", last;
-x "$path/ispell" and $spell_cmd="ispell -l", last;
-x "$path/aspell" and $spell_cmd="aspell list", last;
}
$ENV{SPELL_CMD} and $spell_cmd = $ENV{SPELL_CMD};
$spell_cmd or plan skip_all => "no spell/ispell/aspell";
#diag "spell_cmd = $spell_cmd";
$ENV{LANG} = 'C';
add_stopwords(<DATA>);
set_spell_cmd($spell_cmd);
all_pod_files_spelling_ok('lib');
__DATA__
AnnoCPAN
CPAN
RT
(背景画像は
[ Pearl Box ] http://flap.vis.ne.jp/pxb/
で配布されているものを加工したものです☆)