— |
$Bot::Cobalt::Conf::VERSION = '0.021002' ;
has etc => (
required => 1,
is => 'rw' ,
isa => Path,
coerce => 1,
);
has debug => (
is => 'rw' ,
isa => Bool,
builder => sub { 0 }
);
has path_to_core_cf => (
lazy => 1,
is => 'rwp' ,
isa => Path,
coerce => 1,
builder => sub {
path( shift ->etc . '/cobalt.conf' )
},
);
has path_to_channels_cf => (
lazy => 1,
is => 'rwp' ,
isa => Path,
coerce => 1,
builder => sub {
path( shift ->etc . '/channels.conf' )
},
);
has path_to_plugins_cf => (
lazy => 1,
is => 'rwp' ,
isa => Path,
coerce => 1,
builder => sub {
path( shift ->etc . '/plugins.conf' )
},
);
has core => (
lazy => 1,
is => 'ro' ,
predicate => 'has_core' ,
writer => 'set_core' ,
isa => InstanceOf[ 'Bot::Cobalt::Conf::File::Core' ],
builder => sub {
my ( $self ) = @_ ;
Bot::Cobalt::Conf::File::Core->new(
debug => $self ->debug,
cfg_path => $self ->path_to_core_cf,
)
},
);
has channels => (
lazy => 1,
is => 'ro' ,
predicate => 'has_channels' ,
writer => 'set_channels' ,
isa => InstanceOf[ 'Bot::Cobalt::Conf::File::Channels' ],
builder => sub {
my ( $self ) = @_ ;
Bot::Cobalt::Conf::File::Channels->new(
debug => $self ->debug,
cfg_path => $self ->path_to_channels_cf,
)
},
);
has plugins => (
lazy => 1,
is => 'ro' ,
predicate => 'has_plugins' ,
writer => 'set_plugins' ,
isa => InstanceOf[ 'Bot::Cobalt::Conf::File::Plugins' ],
builder => sub {
my ( $self ) = @_ ;
Bot::Cobalt::Conf::File::Plugins->new(
debug => $self ->debug,
cfg_path => $self ->path_to_plugins_cf,
etcdir => $self ->etc,
)
},
);
1;
|