| 1 | package Mojolicious::Plugin::Logite; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 1 | ▶ | use base 'Mojolicious::Plugin'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use MojoX::Logite; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | sub register | ||||||||||||
| 11 | 1 | ▶ | { | ||||||||||
|
Subroutine
register: called CC=4 SCAR=14.3
Pod
documented
| |||||||||||||
| 12 | 1 | my ($self, $app, $conf) = @_; | |||||||||||
| 13 | |||||||||||||
| 14 | 1 | ▶ | $conf ||= {}; | ||||||||||
|
Condition50%1/2
$conf ||= {}
MC/DC0%0/1
$conf ||= {}
$conf
Truth table50%1/2
A
A= $conf
| |||||||||||||
| 15 | |||||||||||||
| 16 | 1 | ▶ | my $stash_key = delete $conf->{stash_key} || 'logite'; | ||||||||||
|
Condition50%1/2
delete $conf->{'stash_key'} || 'logite'
MC/DC0%0/1
delete $conf->{'stash_key'} || 'logite'
delete $conf->{'stash_key'}
Truth table50%1/2
A
A= delete $conf->{'stash_key'}
| |||||||||||||
| 17 | |||||||||||||
| 18 | $conf->{'path'} = $app->home->rel_file('log/mojo_log.db') | ||||||||||||
| 19 | 1 | ▶ | unless (exists $conf->{'path'}); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 20 | |||||||||||||
| 21 | 1 | my $logite = MojoX::Logite->new (%$conf); | |||||||||||
| 22 | |||||||||||||
| 23 | # Default | ||||||||||||
| 24 | 1 | $app->defaults($stash_key => $logite); | |||||||||||
| 25 | |||||||||||||
| 26 | 1 | return $logite; | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 1 | 1; | |||||||||||
| 30 | __END__ | ||||||||||||