Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add PostProcessor plugin pipeline
  • Loading branch information
zoffixznet committed Nov 25, 2015
1 parent b617f22 commit e58d9ca
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/ModulesPerl6/DbBuilder/Dist.pm
Expand Up @@ -8,6 +8,10 @@ use namespace::clean;
use Module::Pluggable search_path => ['ModulesPerl6::DbBuilder::Dist::Source'],
sub_name => '_sources',
require => 1;
use Module::Pluggable search_path
=> ['ModulesPerl6::DbBuilder::Dist::PostProcessor'],
sub_name => '_postprocessors',
require => 1;

has _build_id => (
init_arg => 'build_id',
Expand Down Expand Up @@ -73,6 +77,14 @@ sub _load_from_source {
dist_db => $self->_dist_db,
)->load;
$dist->{build_id} = $self->_build_id;

for my $postprocessor ( $self->_postprocessors ) {
$postprocessor->new(
meta_url => $url,
dist => $dist,
)->process;
}

return $dist;
}
log error => "Could not find a source module that could handle dist URL "
Expand Down
10 changes: 10 additions & 0 deletions lib/ModulesPerl6/DbBuilder/Dist/PostProcessor.pm
@@ -0,0 +1,10 @@
package ModulesPerl6::DbBuilder::Dist::PostProcessor;

use strictures 2;

use ModulesPerl6::DbBuilder::Log;

use Moo;
use namespace::clean;

1;
11 changes: 11 additions & 0 deletions lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/TravisCI.pm
@@ -0,0 +1,11 @@
package ModulesPerl6::DbBuilder::Dist::PostProcessor::TravisCI;

use strictures 2;
use base 'ModulesPerl6::DbBuilder::Dist::PostProcessor';

use ModulesPerl6::DbBuilder::Log;

use Moo;
use namespace::clean;

1;

0 comments on commit e58d9ca

Please sign in to comment.