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

filter: Statementstmt 50.0% 10 / 20 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 45.4% 15 / 33 CC 4 SCAR 23.6
CC
4
Cov
38%
said
20.0
help
2.0
BEGIN
1.0
CRAP 10.6
« lib/Bot/BasicBot/Pluggable/Module/Hyperarchive.pm ↑ Summary lib/Bot/BasicBot/Pluggable/Module/Foldoc.pm »
1 package Bot::BasicBot::Pluggable::Module::Websters;
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=4 SCAR=30.0
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 =~ s!^\s*websters (for )?!!i;
Branch: 1 branch
BranchTrueFalseTotal
unless $body =~ s/^\s*websters (for )?//i 0 0 0
17
18 0 ▶ return "You must supply a word" unless $body =~ /\w+/;
Branch: 1 branch
BranchTrueFalseTotal
unless $body =~ /\w+/ 0 0 0
19 0 my $q = $body; $q =~ s/\W+/+/g;
20 0 return "$body may be sought at http://www.m-w.com/cgi-bin/dictionary?va=$q";
21  
22 }
23  
24 0 ▶sub help {
Subroutine help: not called CC=1 SCAR=6.9
Pod documented
25 0 return "Commands: 'websters (for ) <word>'";
26 }
27  
28 1 1;
29  
30 =head1 NAME
31  
32 Bot::BasicBot::Pluggable::Module::Websters - give the url of a word in Websters
33  
34 =head1 SYNOPSIS
35  
36 This is almost useless but it's provided as part of Infobot backwards compatability.
37  
38 =head1 IRC USAGE
39  
40 websters (for ) <word>
41  
42 =head1 AUTHOR
43  
44 Simon Wistow, <simon@thegestalt.org>
45  
46 =head1 COPYRIGHT
47  
48 Copyright 2005, Simon Wistow
49  
50 Distributed under the same terms as Perl itself.
51  
52 =head1 SEE ALSO
53  
54  
55 =cut
56  
« lib/Bot/BasicBot/Pluggable/Module/Hyperarchive.pm ↑ Summary lib/Bot/BasicBot/Pluggable/Module/Foldoc.pm »