blib/lib/Mojolicious/Plugin/JavaScript/Console.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 29 / 29 CC 2 SCAR 2.5
CC
2
Cov
100%
register
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary
1 package Mojolicious::Plugin::JavaScript::Console;
2  
3 # ABSTRACT: use the JavaScript console from Mojolicious applications
4  
5 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use Mojo::Base qw(Mojolicious::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use JavaScript::Console;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 our $VERSION = '0.03';
12  
13 7 ▶sub register {
Subroutine register: called CC=2 SCAR=6.9
Pod documented
14 7 my ($plugin, $mojo, $param) = @_;
15  
16 7 ▶ $param = {} if 'HASH' ne ref $param;
Branch: 1 branch
BranchTrueFalseTotal
if "HASH" ne ref $param 1 6 7
17  
18 7 my $console = JavaScript::Console->new( %{ $param } );
19  
20 $mojo->helper(
21 16 ▶ 'console' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
22 16 $console;
23 }
24 7 );
25 }
26  
27 7 1;
28  
29 __END__
↑ Summary