File Coverage

blib/lib/Raisin/Util.pm
Criterion Covered Total %
statement 18 18 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 2 2 100.0
total 30 30 100.0


line stmt bran cond sub pod time code
1             #!perl
2             #PODNAME: Raisin::Util
3             #ABSTRACT: Utility subroutine for Raisin.
4              
5 17     17   68577 use strict;
  17         46  
  17         519  
6 17     17   92 use warnings;
  17         60  
  17         802  
7              
8             package Raisin::Util;
9             $Raisin::Util::VERSION = '0.93';
10 17     17   2782 use Plack::Util;
  17         62923  
  17         3995  
11              
12             sub make_tag_from_path {
13 20     20 1 1192 my $path = shift;
14 20         60 my @c = (split '/', $path);
15 20 100       58 return 'none' unless scalar @c;
16 19 100       129 $c[-2] || $c[1];
17             }
18              
19             sub iterate_params {
20 157     157 1 3206 my $params = shift;
21 157         218 my $index = 0;
22              
23             return sub {
24 267     267   362 $index += 2;
25 267         913 ($params->[$index-2], $params->[$index-1]);
26 157         643 };
27             }
28              
29             1;
30              
31             __END__