File Coverage

blib/lib/Bot/Cobalt/Plugin/Silly/OutputLOLCAT.pm
Criterion Covered Total %
statement 16 33 48.4
branch n/a
condition 0 3 0.0
subroutine 6 9 66.6
pod 0 4 0.0
total 22 49 44.9


line stmt bran cond sub pod time code
1             package Bot::Cobalt::Plugin::Silly::OutputLOLCAT;
2             $Bot::Cobalt::Plugin::Silly::OutputLOLCAT::VERSION = '0.031002';
3 1     1   882 use strictures 2;
  1         5  
  1         29  
4              
5 1     1   128 use POE::Filter::Stackable;
  1         12  
  1         15  
6 1     1   4 use POE::Filter::Line;
  1         1  
  1         12  
7 1     1   3 use POE::Filter::LOLCAT;
  1         0  
  1         17  
8              
9 1     1   3 use Bot::Cobalt::Common;
  1         1  
  1         4  
10              
11             sub FILTER () { 0 }
12              
13 1     1 0 244 sub new { bless [undef], shift }
14              
15             sub Cobalt_register {
16 0     0 0   my ($self, $core) = splice @_, 0, 2;
17            
18 0           $core->plugin_register( $self, 'USER',
19             'message'
20             );
21            
22 0           $core->log->info("Loaded");
23            
24 0           PLUGIN_EAT_NONE
25             }
26              
27             sub Cobalt_unregister {
28 0     0 0   my ($self, $core) = splice @_, 0, 2;
29            
30 0           $core->log->info("Unloaded");
31            
32 0           PLUGIN_EAT_NONE
33             }
34              
35             sub Outgoing_message {
36 0     0 0   my ($self, $core) = splice @_, 0, 2;
37              
38 0   0       my $filter = $self->[FILTER] //= POE::Filter::Stackable->new(
39             Filters => [
40             POE::Filter::Line->new(),
41             POE::Filter::LOLCAT->new(),
42             ],
43             );
44              
45 0           $filter->get_one_start([${$_[2]}."\n"]);
  0            
46              
47 0           my $lol = $filter->get_one;
48              
49 0           my $cat = shift @$lol;
50 0           chomp($cat);
51              
52 0           ${$_[2]} = $cat;
  0            
53              
54 0           PLUGIN_EAT_NONE
55             }
56              
57             1;
58             __END__