File Coverage

blib/lib/App/Twirc/Plugin/BangCommands.pm
Criterion Covered Total %
statement 11 11 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 17 19 89.4


line stmt bran cond sub pod time code
1             package App::Twirc::Plugin::BangCommands;
2             $App::Twirc::Plugin::BangCommands::VERSION = '0.20';
3 1     1   12748 use warnings;
  1         1  
  1         23  
4 1     1   3 use strict;
  1         1  
  1         85  
5              
6 1     1 0 2763 sub new { bless {}, shift }
7              
8             sub preprocess {
9 3     3 0 855 my (undef,undef,undef,undef, $textref) = @_;
10              
11 3 100       13 unless ( $$textref =~ s/^!\s*// ) {
12 1         3 $$textref = "post $$textref";
13             }
14 3         5 return;
15             }
16              
17             1;
18              
19             __END__
20              
21             =head1 NAME
22              
23             App::Twirc::Plugin::BangCommands - Commands prefixed with !
24              
25             =head1 SYNOPSIS
26              
27             # in config (.yml in this example)
28             plugins:
29             -BangCommands
30              
31             # in your IRC clientt
32             This is a status message (no "post" prefix necessary)
33             !follow net_twitter
34             !rate_limit_status
35              
36             =head1 DESCRIPTION
37              
38             In your IRC client, text entered without an exclamation point (!) prefix will
39             be posted as a status message. Commands start with an exclamation mark (!)
40             prefix.
41              
42             =head1 AUTHOR
43              
44             Marc Mims <marc@questright.com>
45              
46             =head1 LICENSE
47              
48             Copyright (c) 2009 Marc Mims
49              
50             You may distribute this code and/or modify it under the same terms as Perl itself.
51              
52             =cut