blib/lib/Mojolicious/Plugin/Mojolyst.pm

filter: Statementstmt 55.5% 10 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 63.6% 14 / 22 CC 3 SCAR 16.0
CC
3
Cov
56%
register
7.6
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
↑ Summary
1 package Mojolicious::Plugin::Mojolyst;
2 1 ▶use Mojo::Base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 our $VERSION = '0.01';
5  
6 1 ▶use Mojo::Loader qw/find_modules load_class/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub register {
Subroutine register: called CC=3 SCAR=20.3
Pod documented
9 1 my ($self, $app, $conf) = @_;
10  
11 # Discover controllers
12 1 for my $class ( find_modules $conf->{controllers} ) {
13  
14 # Steal children
15 0 my $e = load_class $class;
16 0 my @children = @{$class->new->routes->children};
17 0 $app->routes->add_child($_) for @children;
18  
19 # Make DATA sections accessible
20 0 push @{$app->static->classes}, $class;
21 0 push @{$app->renderer->classes}, $class;
22 }
23 }
24  
25 1 1;
26 __END__
↑ Summary