lib/Bot/BasicBot/Pluggable/Module/Foldoc.pm

filter: Statementstmt 43.4% 10 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 44.1% 15 / 34 CC 3 SCAR 17.7
CC
3
Cov
37%
said
12.0
help
2.0
BEGIN
1.0
CRAP 5.9
« lib/Bot/BasicBot/Pluggable/Module/Websters.pm ↑ Summary lib/Bot/BasicBot/Pluggable/Module/Bash.pm »
1 package Bot::BasicBot::Pluggable::Module::Foldoc;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Bot::BasicBot::Pluggable::Module;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use base qw(Bot::BasicBot::Pluggable::Module);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 0 ▶sub said {
Subroutine said: not called CC=3 SCAR=24.8
Pod documented
9 0 my ($self, $mess, $pri) = @_;
10  
11 0 my $body = $mess->{body};
12 0 my $who = $mess->{who};
13  
14 0 ▶ return unless ($pri == 2);
Branch: 1 branch
BranchTrueFalseTotal
unless $pri == 2 0 0 0
15  
16 0 ▶ return unless $body =~ m!^\s*foldoc(?: for)?\s+(.*)!i;
Branch: 1 branch
BranchTrueFalseTotal
unless $body =~ /^\s*foldoc(?: for)?\s+(.*)/i 0 0 0
17  
18 0 my ($terms) = $1;
19 0 $terms =~ s/\?\W*$//;
20  
21 0 my $key= $terms;
22 0 $key =~ s/\s+$//;
23 0 $key =~ s/^\s+//;
24 0 $key =~ s/\W+/+/g;
25  
26 0 return "$terms may be sought in foldoc at http://foldoc.org/?$key";
27  
28 }
29  
30 0 ▶sub help {
Subroutine help: not called CC=1 SCAR=6.9
Pod documented
31 0 return "Commands: 'websters (for ) <word>'";
32 }
33  
34 1 1;
35  
36 =head1 NAME
37  
38 Bot::BasicBot::Pluggable::Module::Foldoc - give the url of a word in Foldoc
39  
40 =head1 SYNOPSIS
41  
42 This is almost useless but it's provided as part of Infobot backwards compatability.
43  
44 =head1 IRC USAGE
45  
46 foldoc (for ) <word>
47  
48 =head1 AUTHOR
49  
50 Simon Wistow, <simon@thegestalt.org>
51  
52 =head1 COPYRIGHT
53  
54 Copyright 2005, Simon Wistow
55  
56 Distributed under the same terms as Perl itself.
57  
58 =head1 SEE ALSO
59  
60  
61 =cut
62  
« lib/Bot/BasicBot/Pluggable/Module/Websters.pm ↑ Summary lib/Bot/BasicBot/Pluggable/Module/Bash.pm »