From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

BEGIN {
$Poke::ConfigLoader::VERSION = '1.101040';
}
class Poke::ConfigLoader
{
use MooseX::Types::Moose(':all');
use Poke::Types(':all');
has config_source =>
(
is => 'ro',
isa => subtype(Str, where { -e $_ }),
required => 1,
);
has config =>
(
is => 'ro',
isa => PokeConfig,
traits => ['Hash'],
lazy_build => 1,
handles =>
{
'poke_config' => [ get => 'Poke'],
'logger_config' => [ get => 'Logger'],
'schema_config' => [ get => 'Schema'],
'web_config' => [ get => 'Web'],
'pool_config' => [ get => 'WorkerPool'],
},
);
method _build_config { Poke::Util->load_config($self->config_source) }
has jobs_config =>
(
is => 'ro',
isa => JobConfigurations,
lazy_build => 1,
);
method _build_jobs_config
{
my $junc = [qw/Poke Logger Schema Web WorkerPool/]->all;
my $jcfg = $self->config
->kv
->grep(sub {$junc ne $_->[0]});
$jcfg->each_value(sub {Class::MOP::load_class($_->[0])});
return $jcfg;
}
}
1;
=pod
=head1 NAME
Poke::ConfigLoader
=head1 VERSION
version 1.101040
=head1 AUTHOR
Nicholas Perez <nperez@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Infinity Interactive.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__