Last active
December 14, 2015 05:19
-
-
Save rwstauner/5034508 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package inc::AlienBuild; | |
use Moose; | |
extends 'Dist::Zilla::Plugin::ModuleBuild'; | |
with 'Dist::Zilla::Role::FileGatherer'; | |
sub gather_files { | |
my ($self) = @_; | |
my $file = $self->zilla->main_module->name; | |
# use the on-disk file if there is one | |
return if $self->zilla->files->grep(sub { $_->name eq $file }); | |
# otherwise generate one | |
$self->add_file( | |
Dist::Zilla::File::InMemory->new( | |
name => $file, | |
content => 'package Alien::Getty; 1;', | |
), | |
); | |
} | |
has "+mb_class" => ( | |
default => 'Alien::Base::ModuleBuild', | |
); | |
around module_build_args => sub { | |
my ($orig, $self, @args) = @_; | |
return { | |
%{ $self->$orig(@args) }, | |
alien_name => 'name', | |
alien_repo => { | |
other => 'stuff', | |
}, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment