blib/lib/Yeb/Plugin/Session.pm

filter: Statementstmt 61.9% 13 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 1 totaltotal 56.6% 17 / 30 CC 1 SCAR 4.1
CC
1
Cov
62%
BUILD
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.5
↑ Summary
1 package Yeb::Plugin::Session;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $Yeb::Plugin::Session::AUTHORITY = 'cpan:GETTY';
4 }
5 # ABSTRACT: Yeb Plugin for Plack::Middleware::Session
6 1 $Yeb::Plugin::Session::VERSION = '0.100';
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Plack::Middleware::Session;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Plack::Session::Store::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 has app => ( is => 'ro', required => 1, weak_ref => 1 );
12  
13 0 ▶sub BUILD {
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my ( $self ) = @_;
15 0 $self->app->add_middleware(Plack::Middleware::Session->new(
16 store => Plack::Session::Store::File->new
17 ));
18 0 ▶ $self->app->register_function('session',sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
19 0 $self->app->hash_accessor_empty($self->app->cc->env->{'psgix.session'},@_);
20 0 });
21 0 ▶ $self->app->register_function('session_has',sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 0 $self->app->hash_accessor_has($self->app->cc->env->{'psgix.session'},@_);
23 0 });
24 0 ▶ $self->app->register_function('clear_session',sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 0 $self->app->cc->env->{'psgix.session'} = {};
26 0 });
27 }
28  
29 1 1;
30  
31 __END__
↑ Summary