|
NAMEClass::Component::Component::Plaggerize - extend your module like from Plagger component SYNOPSISmyapp.pl #!/usr/bin/perl
use strict;
use warnings;
use MyApp;
MyApp->new({ config => 'config.yaml' })->run;
config.yaml plugins:
- module: Test
config: hello
MyApp.pm package MyApp;
use strict;
use warnings;
use Class::Component;
__PACKAGE__->load_components(qw/ Plaggerize /);
sub run {
my $self = shift;
$self->log( debug => 'running start' );
$self->run_hook('test');
}
1;
MyApp/Plugin/Test.pm package MyApp::Plugin::Test;
use strict;
use warnings;
use base 'Class::Component::Plugin';
sub test : Hook('test') {
my($self, $c) = @_;
use Data::Dumper;
$c->log( debug => 'testmethod:' . Dumper($self->config) );
}
1;
METHODS
SETUP METHODSAUTHORKazuhiro Osawa <ko@yappo.ne.jp> SEE ALSOClass::Component LICENSEThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|