]>
Commit | Line | Data |
---|---|---|
8294bf44 TC |
1 | #!perl -w |
2 | use strict; | |
3 | use Test::More; | |
4 | use ExtUtils::Manifest qw(maniread); | |
5 | use File::Temp; | |
6 | eval "use Pod::Spell 1.01"; | |
7 | plan skip_all => "Pod::Spell 1.01 required for spellchecking POD" if $@; | |
8 | my $manifest = maniread(); | |
9 | my @pod = sort grep !/^inc/ && /\.(pm|pl|pod|PL)$/, keys %$manifest; | |
10 | plan tests => scalar(@pod); | |
11 | my @stopwords = qw/ | |
12 | Imager | |
13 | Imager's | |
14 | IMAGER | |
15 | GIF | |
16 | JPEG | |
17 | PNG | |
18 | TIFF | |
19 | BMP | |
20 | SGI | |
21 | TGA | |
22 | RGB | |
23 | ICO | |
24 | PNM | |
25 | bilevel | |
26 | dpi | |
27 | Arnar | |
28 | Hrafnkelsson | |
29 | API | |
30 | paletted | |
31 | guassian | |
32 | metadata | |
33 | CPAN | |
34 | eg | |
35 | ie | |
36 | CMYK | |
37 | HSV | |
38 | CGI | |
39 | const | |
40 | varargs | |
41 | FreeType | |
42 | UTF-8 | |
43 | RGBA | |
44 | postfix | |
45 | infix | |
46 | unary | |
130225b1 | 47 | renderer |
50c75381 TC |
48 | Uncategorized |
49 | Blit | |
8294bf44 TC |
50 | /; |
51 | ||
52 | local %Pod::Wordlist::Wordlist = %Pod::Wordlist::Wordlist; | |
53 | for my $stop (@stopwords) { | |
54 | $Pod::Wordlist::Wordlist{$stop} = 1; | |
55 | } | |
56 | ||
57 | # see for example: | |
58 | # https://bugs.launchpad.net/ubuntu/+source/aspell/+bug/71322 | |
59 | $ENV{LANG} = "C"; | |
60 | $ENV{LC_ALL} = "C"; | |
61 | for my $file (@pod) { | |
62 | my $check_fh = File::Temp->new; | |
63 | my $check_filename = $check_fh->filename; | |
64 | open POD, "< $file" | |
65 | or die "Cannot open $file for spell check: $!\n"; | |
66 | Pod::Spell->new->parse_from_filehandle(\*POD, $check_fh); | |
67 | close $check_fh; | |
68 | ||
69 | my @out = `aspell list <$check_filename`; | |
70 | unless (ok(@out == 0, "spell check $file")) { | |
71 | chomp @out; | |
72 | print "# $_\n" for @out; | |
73 | print "#----\n"; | |
74 | open my $fh, "<", $check_filename; | |
75 | while (<$fh>) { | |
76 | chomp; | |
77 | print "# $_\n"; | |
78 | } | |
79 | print "#----\n"; | |
80 | } | |
81 | } |