lib/MojoMojo/Model/Themes.pm

filter: Statementstmt 41.1% 7 / 17 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 100% 1 / 1 totaltotal 37.0% 10 / 27 CC 4 SCAR 26.1
CC
4
Cov
30%
list
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 13.7
« lib/MojoMojo/Formatter/Include.pm ↑ Summary lib/MojoMojo/Controller/Image.pm »
1 package MojoMojo::Model::Themes;
2  
3 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 35 ▶use parent 'Catalyst::Model';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 MojoMojo::Model::Themes - support for Thematic styles
10  
11 =head1 ACTIONS
12  
13 =head2 list
14  
15 List available themes.
16  
17 =cut
18  
19 0 ▶sub list {
Subroutine list: not called CC=4 SCAR=30.0
Pod documented
20 0 my $self = shift;
21 0 my $theme_dir = MojoMojo->path_to('root', 'static', 'themes');
22 0 my @themes;
23 0 opendir TDH, $theme_dir;
24 0 ▶ while (my $theme = readdir TDH){
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $theme = readdir TDH)) 0 0 0
25 0 ▶ next if $theme =~ /^\.{1,2}/;
Branch: 1 branch
BranchTrueFalseTotal
if $theme =~ /^\.{1,2}/ 0 0 0
26 0 push @themes, $theme;
27 }
28 0 closedir TDH;
29 0 ▶ MojoMojo->log->info("Available themes in " . $theme_dir . ": @themes")
Branch: 1 branch
BranchTrueFalseTotal
if "MojoMojo"->debug 0 0 0
30 if MojoMojo->debug;
31 return @themes
32 0 }
33  
34 =head1 AUTHOR
35  
36 Marcus Ramberg <mramberg@cpan.org>
37  
38 =head1 LICENSE
39  
40 This library is free software. You can redistribute it and/or modify
41 it under the same terms as Perl itself.
42  
43 =cut
44  
45 35 1;
« lib/MojoMojo/Formatter/Include.pm ↑ Summary lib/MojoMojo/Controller/Image.pm »