| 1 | # | ||||||||||
| 2 | # This file is part of Pod-Spelling-CommonMistakes | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is copyright (c) 2014 by Apocalypse. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||
| 8 | # | ||||||||||
| 9 | 2 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | package Pod::Spelling::CommonMistakes; | ||||||||||
| 11 | # git description: 7e441d7 | ||||||||||
| 12 | 2 | $Pod::Spelling::CommonMistakes::VERSION = '2.001'; | |||||||||
| 13 | 2 | our $AUTHORITY = 'cpan:APOCAL'; | |||||||||
| 14 | |||||||||||
| 15 | # ABSTRACT: Adaptor for Pod::Spelling to use CommonMistakes as a checker | ||||||||||
| 16 | |||||||||||
| 17 | 2 | ▶ | use parent 'Pod::Spelling'; # Thanks :) | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 2 | ▶ | use Pod::Spell::CommonMistakes::WordList qw( _check_common _check_case ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | # We override our base... | ||||||||||
| 22 | 2 | ▶ | no warnings 'redefine'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | |||||||||||
| 24 | 2 | ▶ | sub _init { | ||||||||
|
Subroutine
_init: called CC=2 SCAR=7.1
| |||||||||||
| 25 | 2 | ▶ | shift if not ref $_[0]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 2 | my $self = shift; | |||||||||
| 27 | |||||||||||
| 28 | # Nothing magical to do :) | ||||||||||
| 29 | |||||||||||
| 30 | 2 | return $self; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | # Accepts one or more lines of text, returns a list mispelt words. | ||||||||||
| 34 | 10 | ▶ | sub _spell_check_callback { | ||||||||
|
Subroutine
_spell_check_callback: called CC=1 SCAR=0.0
| |||||||||||
| 35 | 10 | my $self = shift; | |||||||||
| 36 | 10 | my @lines = grep { length $_ } split /\s+/, join( ' ', @_ ); | |||||||||
| 37 | 10 | my $err = _check_common( \@lines ); | |||||||||
| 38 | 10 | $err = { %$err, %{ _check_case( \@lines ) } }; | |||||||||
| 39 | |||||||||||
| 40 | 10 | return keys %$err; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 2 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||