blib/lib/Dancer/Plugin/Authen/Simple.pm

filter: Statementstmt 100% 36 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 45 / 45 CC 2 SCAR 1.8
CC
2
Cov
100%
_authen
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Dancer::Plugin::Authen::Simple;
5 {
6 2 $Dancer::Plugin::Authen::Simple::VERSION = '0.130500';
7 }
8 2 ▶use Dancer ':syntax';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Dancer::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Module::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Authen::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Memoize;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 #ABSTRACT: Easy Authentication for Dancer applications via Authen::Simple
15  
16  
17  
18  
19 sub authen
20 2 ▶{
Subroutine authen: called CC=1 SCAR=0.0
21 2 _authen( plugin_setting() );
22 }
23  
24 2 memoize('_authen');
25 sub _authen
26 1 ▶{
Subroutine _authen: called CC=2 SCAR=6.9
27 1 my $conf = shift;
28 1 my @adapters = ();
29 1 $DB::single = 1;
30 1 foreach my $adapter_name ( keys %$conf )
31 {
32 1 my $driver = "Authen::Simple::$adapter_name";
33 1 load $driver;
34 1 push @adapters, $driver->new( %{ $conf->{$adapter_name} } );
35 }
36 1 Authen::Simple->new(@adapters);
37 }
38  
39 2 register authen => \&authen;
40 2 register_plugin for_versions => [ 1, 2 ];
41  
42 __END__
↑ Summary