Jifty/Plugin/SkeletonApp/Dispatcher.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use warnings;
2 use strict;
3  
4 package Jifty::Plugin::SkeletonApp::Dispatcher;
5  
6 =head1 NAME
7  
8 Jifty::Plugin::SkeletonApp::Dispatcher - Dispatcher for SkeletonApp plugin
9  
10 =head1 DESCRIPTION
11  
12 Elementary things for a basic app.
13  
14 =cut
15  
16 use Jifty::Dispatcher -base;
17  
18 =head1 RULES
19  
20 =head2 on '**'
21  
22 Add 'Home' item to the top navigation unless it's there already.
23  
24 =cut
25  
26 on '**' => run {
27 my $top = Jifty->web->navigation;
28  
29 # Do not override the 'Home' menu item if the app had set it already
30 unless ( $top->child('Home') ) {
31 $top->child( Home => url => "/", sort_order => 1, label => _('Home') );
32 }
33 return ();
34 };
35  
36 =head2 before '**'
37  
38 Sets language of the current session if the request has '_jifty_lang' argument.
39  
40 =cut
41  
42 before '**' => run {
43 if (my $lang = Jifty->web->request->arguments->{_jifty_lang}) {
44 Jifty->web->session->set(jifty_lang => $lang);
45 }
46 };
47  
48 1;