HMI/Catalyst.pm

filter: Statementstmt 100% 27 / 27 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 94.8% 37 / 39 CC 3 SCAR 4.8
CC
3
Cov
94%
setup_home
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« HMI/Catalyst/Controller/Queue.pm ↑ Summary HMI/Log.pm »
1 package # hide from PAUSE
2 Hopkins::Plugin::HMI::Catalyst;
3 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 $Hopkins::Plugin::HMI::Catalyst::VERSION = '0.900';
5 }
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 Hopkins::Plugin::HMI::Catalyst - Catalyst application
13  
14 =head1 DESCRIPTION
15  
16 =cut
17  
18 1 ▶use Catalyst;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Catalyst::Engine::Embeddable;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use File::ShareDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 # catalyst compile-time fuckery
24  
25 __PACKAGE__->config(%$Hopkins::Plugin::HMI::catalyst);
26  
27 1 ▶use Hopkins::Plugin::HMI::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 __PACKAGE__->setup(qw/Authentication Session Session::Store::FastMmap Session::State::Cookie Static::Simple/);
30 __PACKAGE__->log(new Hopkins::Plugin::HMI::Log);
31  
32 sub setup_home
33 1 ▶{
Subroutine setup_home: called CC=3 SCAR=11.1
34 1 my $self = shift;
35  
36 1 $self->next::method(@_);
37  
38 1 my $share = eval { File::ShareDir::dist_dir('Hopkins-Plugin-HMI') . '/root' };
39 1 my $local = Hopkins::Plugin::HMI::Catalyst->path_to('share/root');
40  
41 1 ▶ my $root = -d $local ? $local : $share;
Branch: 1 branch
BranchTrueFalseTotal
-d $local ? : 1 0 1
42  
43 1 ▶ die 'unable to determine template location' if not $root;
Branch: 1 branch
BranchTrueFalseTotal
unless $root 0 1 1
44  
45 1 $self->config->{root} = $root;
46 }
47  
48 =head1 AUTHOR
49  
50 Mike Eldridge <diz@cpan.org>
51  
52 =head1 LICENSE
53  
54 This program is free software; you may redistribute it
55 and/or modify it under the same terms as Perl itself.
56  
57 =cut
58  
59 1;
« HMI/Catalyst/Controller/Queue.pm ↑ Summary HMI/Log.pm »