line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Conf::File::Channels; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Conf::File::Channels::VERSION = '0.021001'; |
3
|
5
|
|
|
5
|
|
13013
|
use strictures 2; |
|
5
|
|
|
|
|
1078
|
|
|
5
|
|
|
|
|
151
|
|
4
|
5
|
|
|
5
|
|
645
|
use Carp; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
225
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
415
|
use Bot::Cobalt::Common ':types'; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
22
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
423
|
use Moo; |
|
5
|
|
|
|
|
5885
|
|
|
5
|
|
|
|
|
20
|
|
10
|
|
|
|
|
|
|
extends 'Bot::Cobalt::Conf::File'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub context { |
14
|
2
|
|
|
2
|
1
|
1240
|
my ($self, $context) = @_; |
15
|
2
|
50
|
|
|
|
8
|
croak "context() requires a server context identifier" |
16
|
|
|
|
|
|
|
unless defined $context; |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
|
|
37
|
$self->cfg_as_hash->{$context} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
around 'validate' => sub { |
23
|
|
|
|
|
|
|
my ($orig, $self, $cfg) = @_; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my @contexts = keys %$cfg; |
26
|
|
|
|
|
|
|
die "There are no contexts defined.\n" unless @contexts; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
for my $context (@contexts) { |
29
|
|
|
|
|
|
|
die "Context directive $context is not a hash" |
30
|
|
|
|
|
|
|
unless ref $cfg->{$context} eq 'HASH'; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1 |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |