From 9c0cb8d728461b2947c1567dd842a175a7f80fba Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 10 Jan 2011 15:20:41 -0600 Subject: actually, make the dzil plugin its own dist --- lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm | 77 ----------------------------- 1 file changed, 77 deletions(-) delete mode 100644 lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm (limited to 'lib') diff --git a/lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm b/lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm deleted file mode 100644 index 0c6ddcd..0000000 --- a/lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm +++ /dev/null @@ -1,77 +0,0 @@ -package Dist::Zilla::Plugin::MakefilePL::Develop; -use Moose; - -with qw( - Dist::Zilla::Role::FileGatherer - Dist::Zilla::Role::FileMunger - Dist::Zilla::Role::FilePruner -); - -sub gather_files { - my $self = shift; - return unless $self->zilla->isa('Dist::Zilla::Dist::Minter'); - - (my $mod_name = $self->zilla->name) =~ s/-/::/g; - my $content = < '$mod_name', -); -CONTENTS - - $self->add_file( - Dist::Zilla::File::InMemory->new( - name => 'Makefile.PL', - content => $content, - ) - ); -} - -sub munge_files { - my $self = shift; - return unless $self->zilla->isa('Dist::Zilla::Dist::Minter'); - - my ($dist_ini) = grep { $_->name eq 'dist.ini' } @{ $self->zilla->files }; - return unless $dist_ini; - - if ($dist_ini->isa('Dist::Zilla::File::OnDisk')) { - my $content = $dist_ini->content; - Dist::Zilla::File::InMemory->meta->rebless_instance( - $dist_ini, - content => $content . "\n[MakefilePL::Develop]\n", - ); - } - elsif ($dist_ini->isa('Dist::Zilla::File::InMemory')) { - $dist_ini->content($dist_ini->content . "\n[MakefilePL::Develop]\n"); - } - elsif ($dist_ini->isa('Dist::Zilla::File::FromCode')) { - my $code = $dist_ini->code; - my $weak_dist_ini = $dist_ini; - Scalar::Util::weaken($weak_dist_ini); - $dist_ini->code(sub { - $weak_dist_ini->$code . "\n[MakefilePL::Develop]\n" - }); - } -} - -sub prune_files { - my $self = shift; - return unless $self->zilla->isa('Dist::Zilla::Dist::Builder'); - for my $file (@{ $self->zilla->files }) { - next unless $file->name eq 'Makefile.PL'; - $self->zilla->prune_file($file); - } -} - -__PACKAGE__->meta->make_immutable; -no Moose; - -1; -- cgit v1.2.3-54-g00ecf