App/Twirc/Plugin/BangCommands.pm

filter: Statementstmt 100% 12 / 12 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 2 totaltotal 90.0% 18 / 20 CC 2 SCAR 3.4
CC
2
Cov
100%
preprocess
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« POE/Component/Server/Twirc/State.pm ↑ Summary POE/Component/Server/Twirc.pm »
1 package App::Twirc::Plugin::BangCommands;
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶sub new { bless {}, shift }
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
6  
7 sub preprocess {
8 3 ▶ my (undef,undef,undef,undef, $textref) = @_;
Subroutine preprocess: called CC=2 SCAR=6.9
Pod undocumented
9  
10 3 ▶ unless ( $$textref =~ s/^!\s*// ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($$textref =~ s/^!\s*//) 1 2 3
11 1 $$textref = "post $$textref";
12 }
13 3 return;
14 }
15  
16 1 1;
17  
18 __END__
19  
20 =head1 NAME
21  
22 App::Twirc::Plugin::BangCommands - Commands prefixed with !
23  
24 =head1 SYNOPSIS
25  
26 # in config (.yml in this example)
27 plugins:
28 -BangCommands
29  
30 # in your IRC clientt
31 This is a status message (no "post" prefix necessary)
32 !follow net_twitter
33 !rate_limit_status
34  
35 =head1 DESCRIPTION
36  
37 In your IRC client, text entered without an exclamation point (!) prefix will
38 be posted as a status message. Commands start with an exclamation mark (!)
39 prefix.
40  
41 =head1 AUTHOR
42  
43 Marc Mims <marc@questright.com>
44  
45 =head1 LICENSE
46  
47 Copyright (c) 2009 Marc Mims
48  
49 You may distribute this code and/or modify it under the same terms as Perl itself.
50  
51 =cut
« POE/Component/Server/Twirc/State.pm ↑ Summary POE/Component/Server/Twirc.pm »