Jifty/Plugin/Config/Dispatcher.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 27 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::Config::Dispatcher;
5  
6 =head1 NAME
7  
8 Jifty::Plugin::Config::Dispatcher - dispatcher of the Config plugin
9  
10 =head1 DESCRIPTION
11  
12 Adds dispatching rules required for the Config plugin.
13  
14 =cut
15  
16 use Jifty::Dispatcher -base;
17  
18 =head1 RULES
19  
20 =head2 on '**'
21  
22 Adds 'Configuration' item to the top navigation
23  
24 =cut
25  
26 on '**' => run {
27 my ($plugin) = Jifty->find_plugin('Jifty::Plugin::Config') or return;
28 return unless $plugin->nav_menu;
29  
30 my $top = Jifty->web->navigation;
31  
32 # for now leave check here, but we want Config to be
33 # real plugin someday
34 $top->child(
35 Configuration => url => Jifty::Plugin::Config->config_url,
36 label => _('Configuration'),
37 sort_order => 990,
38 );
39 return ();
40 };
41  
42 before '*' => run {
43 Jifty->api->allow('Jifty::Plugin::Config::Action::AddConfig');
44 Jifty->api->allow('Jifty::Plugin::Config::Action::Config');
45 Jifty->api->allow('Jifty::Plugin::Config::Action::Restart');
46 };
47  
48 1;