line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Conf; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Conf::VERSION = '0.021002'; |
3
|
4
|
|
|
4
|
|
41727
|
use strictures 2; |
|
4
|
|
|
|
|
2210
|
|
|
4
|
|
|
|
|
187
|
|
4
|
4
|
|
|
4
|
|
549
|
use Carp; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
210
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
714
|
use Bot::Cobalt::Common ':types'; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
18
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1395
|
use Bot::Cobalt::Conf::File::Core; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
113
|
|
9
|
4
|
|
|
4
|
|
1625
|
use Bot::Cobalt::Conf::File::Channels; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
85
|
|
10
|
4
|
|
|
4
|
|
1430
|
use Bot::Cobalt::Conf::File::Plugins; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
96
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
20
|
use Path::Tiny; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
159
|
|
13
|
4
|
|
|
4
|
|
16
|
use Types::Path::Tiny -types; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
19
|
|
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
2271
|
use Scalar::Util 'blessed'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
167
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
4
|
|
15
|
use Moo; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
14
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has etc => ( |
21
|
|
|
|
|
|
|
required => 1, |
22
|
|
|
|
|
|
|
is => 'rw', |
23
|
|
|
|
|
|
|
isa => Path, |
24
|
|
|
|
|
|
|
coerce => 1, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has debug => ( |
28
|
|
|
|
|
|
|
is => 'rw', |
29
|
|
|
|
|
|
|
isa => Bool, |
30
|
3
|
|
|
3
|
|
20416
|
builder => sub { 0 } |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has path_to_core_cf => ( |
34
|
|
|
|
|
|
|
lazy => 1, |
35
|
|
|
|
|
|
|
is => 'rwp', |
36
|
|
|
|
|
|
|
isa => Path, |
37
|
|
|
|
|
|
|
coerce => 1, |
38
|
|
|
|
|
|
|
builder => sub { |
39
|
2
|
|
|
2
|
|
3409
|
path( shift->etc .'/cobalt.conf' ) |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has path_to_channels_cf => ( |
44
|
|
|
|
|
|
|
lazy => 1, |
45
|
|
|
|
|
|
|
is => 'rwp', |
46
|
|
|
|
|
|
|
isa => Path, |
47
|
|
|
|
|
|
|
coerce => 1, |
48
|
|
|
|
|
|
|
builder => sub { |
49
|
2
|
|
|
2
|
|
2168
|
path( shift->etc .'/channels.conf' ) |
50
|
|
|
|
|
|
|
}, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
has path_to_plugins_cf => ( |
54
|
|
|
|
|
|
|
lazy => 1, |
55
|
|
|
|
|
|
|
is => 'rwp', |
56
|
|
|
|
|
|
|
isa => Path, |
57
|
|
|
|
|
|
|
coerce => 1, |
58
|
|
|
|
|
|
|
builder => sub { |
59
|
2
|
|
|
2
|
|
1554
|
path( shift->etc .'/plugins.conf' ) |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has core => ( |
65
|
|
|
|
|
|
|
lazy => 1, |
66
|
|
|
|
|
|
|
is => 'ro', |
67
|
|
|
|
|
|
|
predicate => 'has_core', |
68
|
|
|
|
|
|
|
writer => 'set_core', |
69
|
|
|
|
|
|
|
isa => InstanceOf['Bot::Cobalt::Conf::File::Core'], |
70
|
|
|
|
|
|
|
builder => sub { |
71
|
2
|
|
|
2
|
|
1697
|
my ($self) = @_; |
72
|
2
|
|
|
|
|
11
|
Bot::Cobalt::Conf::File::Core->new( |
73
|
|
|
|
|
|
|
debug => $self->debug, |
74
|
|
|
|
|
|
|
cfg_path => $self->path_to_core_cf, |
75
|
|
|
|
|
|
|
) |
76
|
|
|
|
|
|
|
}, |
77
|
|
|
|
|
|
|
); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
has channels => ( |
80
|
|
|
|
|
|
|
lazy => 1, |
81
|
|
|
|
|
|
|
is => 'ro', |
82
|
|
|
|
|
|
|
predicate => 'has_channels', |
83
|
|
|
|
|
|
|
writer => 'set_channels', |
84
|
|
|
|
|
|
|
isa => InstanceOf['Bot::Cobalt::Conf::File::Channels'], |
85
|
|
|
|
|
|
|
builder => sub { |
86
|
2
|
|
|
2
|
|
2249
|
my ($self) = @_; |
87
|
2
|
|
|
|
|
34
|
Bot::Cobalt::Conf::File::Channels->new( |
88
|
|
|
|
|
|
|
debug => $self->debug, |
89
|
|
|
|
|
|
|
cfg_path => $self->path_to_channels_cf, |
90
|
|
|
|
|
|
|
) |
91
|
|
|
|
|
|
|
}, |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
has plugins => ( |
95
|
|
|
|
|
|
|
lazy => 1, |
96
|
|
|
|
|
|
|
is => 'ro', |
97
|
|
|
|
|
|
|
predicate => 'has_plugins', |
98
|
|
|
|
|
|
|
writer => 'set_plugins', |
99
|
|
|
|
|
|
|
isa => InstanceOf['Bot::Cobalt::Conf::File::Plugins'], |
100
|
|
|
|
|
|
|
builder => sub { |
101
|
2
|
|
|
2
|
|
1520
|
my ($self) = @_; |
102
|
2
|
|
|
|
|
31
|
Bot::Cobalt::Conf::File::Plugins->new( |
103
|
|
|
|
|
|
|
debug => $self->debug, |
104
|
|
|
|
|
|
|
cfg_path => $self->path_to_plugins_cf, |
105
|
|
|
|
|
|
|
etcdir => $self->etc, |
106
|
|
|
|
|
|
|
) |
107
|
|
|
|
|
|
|
}, |
108
|
|
|
|
|
|
|
); |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |
112
|
|
|
|
|
|
|
__END__ |