blib/lib/Bot/Cobalt/Conf/File/Channels.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 92.1% 35 / 38 CC 5 SCAR 8.9
CC
5
Cov
90%
__ANON__
4.1
context
2.0
BEGIN
1.0
CRAP 2.4
« blib/lib/Bot/Cobalt/IRC/Server.pm ↑ Summary blib/lib/Bot/Cobalt/Plugin/OutputFilters/StripColor.pm »
1 package Bot::Cobalt::Conf::File::Channels;
2 1 $Bot::Cobalt::Conf::File::Channels::VERSION = '0.021001';
3 1 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Bot::Cobalt::Common ':types';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 extends 'Bot::Cobalt::Conf::File';
11  
12  
13 sub context {
14 1 ▶ my ($self, $context) = @_;
Subroutine context: called CC=2 SCAR=7.1
Pod documented
15 1 ▶ croak "context() requires a server context identifier"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $context 0 1 1
16 unless defined $context;
17  
18 1 $self->cfg_as_hash->{$context}
19 }
20  
21  
22 around 'validate' => sub {
23 1 ▶ my ($orig, $self, $cfg) = @_;
Subroutine __ANON__: called CC=4 SCAR=14.1
24  
25 1 my @contexts = keys %$cfg;
26 1 ▶ die "There are no contexts defined.\n" unless @contexts;
Branch: 1 branch
BranchTrueFalseTotal
unless @contexts 0 1 1
27
28 1 for my $context (@contexts) {
29 die "Context directive $context is not a hash"
30 1 ▶ unless ref $cfg->{$context} eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $cfg->{$context} eq "HASH" 0 1 1
31 }
32  
33 1
34 1 };
35  
36  
37 1 1;
38 __END__
« blib/lib/Bot/Cobalt/IRC/Server.pm ↑ Summary blib/lib/Bot/Cobalt/Plugin/OutputFilters/StripColor.pm »