Gungho/Inline.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 10 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 68 CC 6 SCAR 20.4
CC
6
Cov
0%
BEGIN
12.0
bootstrap
12.0
_setup_old_parameters
6.0
CRAP 7.7
1 # $Id: /mirror/gungho/lib/Gungho/Inline.pm 39015 2008-01-16T15:58:40.917983Z lestrrat $
2 #
3 # Copyright (c) 2007 Daisuke Maki <daisuke@endeworks.jp>
4 # Copyright (c) 2007 Kazuho Oku
5 # All rights reserved.
6  
7 package Gungho::Inline;
8 use strict;
9 use warnings;
10 use base qw(Gungho);
11 use Gungho::Request;
12  
13 BEGIN
14 {
15 if (! __PACKAGE__->can('OLD_PARAMETER_LIST')) {
16 my $old_parameter_list = $ENV{GUNGHO_INLINE_OLD_PARAMETER_LIST} || 0;
17 eval "sub OLD_PARAMETER_LIST() { $old_parameter_list } ";
18 die if $@;
19 }
20 }
21  
22 sub bootstrap
23 {
24 my $class = shift;
25 if (&OLD_PARAMETER_LIST) {
26 $class->_setup_old_parameters(@_);
27 } else {
28 my $config = $class->load_config(shift);
29 my $opts = shift || {};
30  
31 foreach my $k qw(provider handler) {
32 if ($opts->{$k} && ref $opts->{$k} eq 'CODE') {
33 $config->{$k} = {
34 module => qw(Inline),
35 config => {
36 callback => $opts->{$k},
37 },
38 };
39 }
40 }
41 @_ = ($config);
42 }
43  
44 $class->next::method(@_);
45 }
46  
47 sub _setup_old_parameters
48 {
49 my $class = shift;
50 my $config = shift;
51
52 foreach my $k qw(provider handler) {
53 if ($config->{$k} && ref $config->{$k} eq 'CODE') {
54 $config->{$k} = {
55 module => qw(Inline),
56 config => {
57 callback => $config->{$k},
58 },
59 };
60 }
61 }
62 }
63  
64 1;
65  
66 __END__