blib/lib/Bot/Cobalt/Conf.pm

filter: Statementstmt 100% 40 / 40 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 17 / 17 Podpod n/a totaltotal 100% 57 / 57 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« bin/cobalt2-installer ↑ Summary blib/lib/Bot/Cobalt/IRC/Event/Channel.pm »
1 package Bot::Cobalt::Conf;
2 $Bot::Cobalt::Conf::VERSION = '0.021003';
3 3 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Bot::Cobalt::Common ':types';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Bot::Cobalt::Conf::File::Core;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Bot::Cobalt::Conf::File::Channels;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Bot::Cobalt::Conf::File::Plugins;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Types::Path::Tiny -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17  
18 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 1 ▶ builder => sub { 0 }
Subroutine __ANON__: called CC=1 SCAR=0.0
31 );
32  
33 has path_to_core_cf => (
34 lazy => 1,
35 is => 'rwp',
36 isa => Path,
37 coerce => 1,
38 1 ▶ builder => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
39 1 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 1 ▶ builder => sub {
Subroutine _build_path_to_channels_cf: called CC=1 SCAR=0.0
49 1 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 1 ▶ builder => sub {
Subroutine _build_path_to_plugins_cf: called CC=1 SCAR=0.0
59 1 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 1 ▶ builder => sub {
Subroutine _build_core: called CC=1 SCAR=0.0
71 1 my ($self) = @_;
72 1 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 1 ▶ builder => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
86 1 my ($self) = @_;
87 1 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 1 ▶ builder => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
101 1 my ($self) = @_;
102 1 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__
« bin/cobalt2-installer ↑ Summary blib/lib/Bot/Cobalt/IRC/Event/Channel.pm »