| 1 | package POE::Component::IRC::Plugin::JavaScript::Minifier; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 1 | our $VERSION = '2.001004'; # VERSION | |||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use base 'POE::Component::IRC::Plugin::BasePoCoWrap'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | ▶ | use POE::Component::JavaScript::Minifier; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 0 | ▶ | sub _make_default_args { | ||||||||||
|
Subroutine
_make_default_args: not called CC=1 SCAR=6.9
| |||||||||||||
| 12 | return ( | ||||||||||||
| 13 | 0 | pastebin_trigger => '[irc_to_pastebin]', | |||||||||||
| 14 | response_event => 'irc_js_minifier', | ||||||||||||
| 15 | trigger => qr/^minify\s*js\s+(?=\S)/i, | ||||||||||||
| 16 | ); | ||||||||||||
| 17 | } | ||||||||||||
| 18 | |||||||||||||
| 19 | 0 | ▶ | sub _make_poco { | ||||||||||
|
Subroutine
_make_poco: not called CC=2 SCAR=17.9
| |||||||||||||
| 20 | 0 | my $self = shift; | |||||||||||
| 21 | return POE::Component::JavaScript::Minifier->spawn( | ||||||||||||
| 22 | debug => $self->{debug}, | ||||||||||||
| 23 | 0 | ▶ | %{ $self->{obj_args} || {} }, | ||||||||||
|
Condition0%0/2
$self->{'obj_args'} || {}
MC/DC0%0/1
$self->{'obj_args'} || {}
$self->{'obj_args'}
Truth table0%0/2
A
A= $self->{'obj_args'}
| |||||||||||||
| 24 | ); | ||||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 0 | ▶ | sub _make_response_message { | ||||||||||
|
Subroutine
_make_response_message: not called CC=3 SCAR=24.8
| |||||||||||||
| 28 | 0 | my $self = shift; | |||||||||||
| 29 | 0 | my $in_ref = shift; | |||||||||||
| 30 | |||||||||||||
| 31 | 0 | my $prefix = ''; | |||||||||||
| 32 | |||||||||||||
| 33 | $in_ref->{_type} eq 'public' | ||||||||||||
| 34 | 0 | ▶ | and $prefix = (split /!/, $in_ref->{_who})[0] . ', '; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 35 | |||||||||||||
| 36 | exists $in_ref->{error} | ||||||||||||
| 37 | 0 | ▶ | and return "$prefix$in_ref->{error}"; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | |||||||||||||
| 39 | 0 | return "${prefix}see $self->{pastebin_trigger}$in_ref->{out}"; | |||||||||||
| 40 | } | ||||||||||||
| 41 | |||||||||||||
| 42 | 0 | ▶ | sub _message_into_response_event { 'out' } | ||||||||||
|
Subroutine
_message_into_response_event: not called CC=1 SCAR=6.9
| |||||||||||||
| 43 | |||||||||||||
| 44 | 0 | ▶ | sub _make_poco_call { | ||||||||||
|
Subroutine
_make_poco_call: not called CC=1 SCAR=6.9
| |||||||||||||
| 45 | 0 | my $self = shift; | |||||||||||
| 46 | 0 | my $data_ref = shift; | |||||||||||
| 47 | |||||||||||||
| 48 | $self->{poco}->minify( { | ||||||||||||
| 49 | event => '_poco_done', | ||||||||||||
| 50 | uri => delete $data_ref->{what}, | ||||||||||||
| 51 | 0 | map +( "_$_" => $data_ref->{$_} ), | |||||||||||
| 52 | keys %$data_ref, | ||||||||||||
| 53 | } | ||||||||||||
| 54 | ); | ||||||||||||
| 55 | } | ||||||||||||
| 56 | 1 | 1; | |||||||||||
| 57 | __END__ | ||||||||||||