| 1 | package Bot::Cobalt::Plugin::Silly::OutputLOLCAT; | ||||||||||||||||||||
| 2 | 1 | $Bot::Cobalt::Plugin::Silly::OutputLOLCAT::VERSION = '0.031001'; | |||||||||||||||||||
| 3 | 1 | ▶ | use strictures 2; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use POE::Filter::Stackable; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use POE::Filter::Line; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use POE::Filter::LOLCAT; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | ▶ | use Bot::Cobalt::Common; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | sub FILTER () { 0 } | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 1 | ▶ | sub new { bless [undef], shift } | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | sub Cobalt_register { | ||||||||||||||||||||
| 16 | 0 | ▶ | my ($self, $core) = splice @_, 0, 2; | ||||||||||||||||||
|
Subroutine
Cobalt_register: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 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 | ▶ | my ($self, $core) = splice @_, 0, 2; | ||||||||||||||||||
|
Subroutine
Cobalt_unregister: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | $core->log->info("Unloaded"); | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | PLUGIN_EAT_NONE | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | sub Outgoing_message { | ||||||||||||||||||||
| 36 | 0 | ▶ | my ($self, $core) = splice @_, 0, 2; | ||||||||||||||||||
|
Subroutine
Outgoing_message: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | ▶ | my $filter = $self->[FILTER] //= POE::Filter::Stackable->new( | ||||||||||||||||||
|
Condition0%0/3
$self->[0] //= "POE::Filter::Stackable"->new("Filters", ["POE::Filter::Line"->new, "POE::Filter::LOLCAT"->new])
MC/DC0%0/2
$self->[0] //= "POE::Filter::Stackable"->new("Filters", ["POE::Filter::Line"->new, "POE::Filter::LOLCAT"->new])
$self->[0]
"POE::Filter::Stackable"->new("Filters", ["POE::Filter::Line"->new, "POE::Filter::LOLCAT"->new])
Truth table0%0/3
A //= B
A= $self->[0]B= "POE::Filter::Stackable"->new("Filters", ["POE::Filter::Line"->new, "POE::Filter::LOLCAT"->new])
| |||||||||||||||||||||
| 39 | Filters => [ | ||||||||||||||||||||
| 40 | POE::Filter::Line->new(), | ||||||||||||||||||||
| 41 | POE::Filter::LOLCAT->new(), | ||||||||||||||||||||
| 42 | ], | ||||||||||||||||||||
| 43 | ); | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | $filter->get_one_start([${$_[2]}."\n"]); | |||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | my $lol = $filter->get_one; | |||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 0 | my $cat = shift @$lol; | |||||||||||||||||||
| 50 | 0 | chomp($cat); | |||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 0 | ${$_[2]} = $cat; | |||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | PLUGIN_EAT_NONE | |||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 1 | 1; | |||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||