blib/lib/MYDan/Project/Apps.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 41 CC 4 SCAR 18.3
CC
4
Cov
0%
ctrl
12.0
new
6.0
BEGIN
2.0
CRAP 6.2
1 package MYDan::Project::Apps;
2  
3 use strict;
4 use warnings;
5  
6 $|++;
7  
8 use MYDan::Util::OptConf;
9 my %o; BEGIN{ %o = MYDan::Util::OptConf->load()->dump('project');};
10  
11 sub new
12 {
13 my ( $class, %self ) = @_;
14  
15 die "name undef" unless $self{name};
16 bless \%self, ref $class || $class;
17 }
18  
19 sub ctrl
20 {
21 my ( $this, @ctrl, @result ) = @_;
22 die "ctrl name undef" unless @ctrl;
23  
24 for my $ctrl ( @ctrl )
25 {
26  
27 my $file = "$o{apps}/$this->{name}/$ctrl";
28 die "$this->{name} $ctrl undef" unless -f $file;
29 push @result, [ $ctrl, `cat '$file'`];
30 }
31 return @result;
32 }
33  
34 1;