File Coverage

blib/lib/Bootylicious/Plugin/Admin.pm
Criterion Covered Total %
statement 13 13 100.0
branch 1 2 50.0
condition 2 5 40.0
subroutine 4 4 100.0
pod 1 1 100.0
total 21 25 84.0


line stmt bran cond sub pod time code
1             package Bootylicious::Plugin::Admin;
2              
3 1     1   437 use strict;
  1         2  
  1         21  
4 1     1   3 use warnings;
  1         1  
  1         19  
5              
6 1     1   2 use base 'Mojolicious::Plugin';
  1         1  
  1         132  
7              
8             require Carp;
9              
10             sub register {
11 1     1 1 23 my ($self, $app, $conf) = @_;
12              
13 1   50     3 $conf ||= {};
14              
15             Carp::croak qq/Password and username are required for this plugin to work/
16 1 50 33     6 unless $conf->{username} && $conf->{password};
17              
18 1         4 $app->routes->route('/admin')->detour(namespace => 'Bootylicious::Admin', conf => $conf);
19             }
20              
21             1;