$App::Standby::Cmd::Command::VERSION
=
'0.04'
;
BEGIN {
$App::Standby::Cmd::Command::AUTHORITY
=
'cpan:TEX'
;
}
use
5.010_000;
has
'_config'
=> (
'is'
=>
'rw'
,
'isa'
=>
'Config::Yak'
,
'lazy'
=> 1,
'builder'
=>
'_init_config'
,
'accessor'
=>
'config'
,
);
has
'_logger'
=> (
'is'
=>
'rw'
,
'isa'
=>
'Log::Tree'
,
'lazy'
=> 1,
'builder'
=>
'_init_logger'
,
'accessor'
=>
'logger'
,
);
has
'_dbh'
=> (
'is'
=>
'rw'
,
'isa'
=>
'App::Standby::DB'
,
'lazy'
=> 1,
'builder'
=>
'_init_dbh'
,
'accessor'
=>
'dbh'
,
);
sub
_init_dbh {
my
$self
=
shift
;
my
$DBH
= App::Standby::DB::->new({
'config'
=>
$self
->config(),
'logger'
=>
$self
->logger(),
});
return
$DBH
;
}
sub
_init_config {
my
$self
=
shift
;
my
$Config
= Config::Yak::->new({
'locations'
=> [
qw(conf/standby-mgm.conf /etc/standby-mgm)
],
});
return
$Config
;
}
sub
_init_logger {
my
$self
=
shift
;
my
$Logger
= Log::Tree::->new(
'standby'
);
return
$Logger
;
}
no
Moose;
__PACKAGE__->meta->make_immutable;
1;