From d61b403f1233e7620b0dc70beaf5c7d7b18063ab Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 10 Jan 2011 09:53:10 -0600 Subject: one more name change --- Changes | 2 +- dist.ini | 4 +- lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm | 77 ++++++++++++++++++++++++++++ lib/Dist/Zilla/Plugin/MakefilePL/Lite.pm | 77 ---------------------------- lib/ExtUtils/MakeMaker/Dist/Zilla.pm | 64 ----------------------- lib/ExtUtils/MakeMaker/Dist/Zilla/Develop.pm | 64 +++++++++++++++++++++++ 6 files changed, 144 insertions(+), 144 deletions(-) create mode 100644 lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm delete mode 100644 lib/Dist/Zilla/Plugin/MakefilePL/Lite.pm delete mode 100644 lib/ExtUtils/MakeMaker/Dist/Zilla.pm create mode 100644 lib/ExtUtils/MakeMaker/Dist/Zilla/Develop.pm diff --git a/Changes b/Changes index 3205a82..c0f6392 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,4 @@ -Revision history for ExtUtils-MakeMaker-Dist-Zilla +Revision history for Dist-Zilla-Plugin-MakefilePL-Develop {{$NEXT}} - Initial release diff --git a/dist.ini b/dist.ini index 6694ae1..07b0f18 100644 --- a/dist.ini +++ b/dist.ini @@ -1,10 +1,10 @@ -name = Dist-Zilla-Plugin-MakefilePL-Lite +name = Dist-Zilla-Plugin-MakefilePL-Develop author = Jesse Luehrs license = Perl_5 copyright_holder = Jesse Luehrs [@DOY] -dist = Dist-Zilla-Plugin-MakefilePL-Lite +dist = Dist-Zilla-Plugin-MakefilePL-Develop [Prereqs] Dist::Zilla = 0 diff --git a/lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm b/lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm new file mode 100644 index 0000000..54b13a6 --- /dev/null +++ b/lib/Dist/Zilla/Plugin/MakefilePL/Develop.pm @@ -0,0 +1,77 @@ +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::Lite]\n", + ); + } + elsif ($dist_ini->isa('Dist::Zilla::File::InMemory')) { + $dist_ini->content($dist_ini->content . "\n[MakefilePL::Lite]\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::Lite]\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; diff --git a/lib/Dist/Zilla/Plugin/MakefilePL/Lite.pm b/lib/Dist/Zilla/Plugin/MakefilePL/Lite.pm deleted file mode 100644 index bf06005..0000000 --- a/lib/Dist/Zilla/Plugin/MakefilePL/Lite.pm +++ /dev/null @@ -1,77 +0,0 @@ -package Dist::Zilla::Plugin::MakefilePL::Lite; -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::Lite]\n", - ); - } - elsif ($dist_ini->isa('Dist::Zilla::File::InMemory')) { - $dist_ini->content($dist_ini->content . "\n[MakefilePL::Lite]\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::Lite]\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; diff --git a/lib/ExtUtils/MakeMaker/Dist/Zilla.pm b/lib/ExtUtils/MakeMaker/Dist/Zilla.pm deleted file mode 100644 index 25f46cb..0000000 --- a/lib/ExtUtils/MakeMaker/Dist/Zilla.pm +++ /dev/null @@ -1,64 +0,0 @@ -package ExtUtils::MakeMaker::Dist::Zilla; -use strict; -use warnings; - -use ExtUtils::MakeMaker (); - -sub import { - warn <<'EOF'; - - ********************************* WARNING ********************************** - - This module uses Dist::Zilla for development. This Makefile.PL will let you - run the tests, but you are encouraged to install Dist::Zilla and the needed - plugins if you intend on doing any serious hacking. - - **************************************************************************** - -EOF - - ExtUtils::MakeMaker->export_to_level(1, @_); -} - -{ - package MY; - - use Config; - - my $message; - BEGIN { - $message = <<'MESSAGE'; - - ********************************* ERROR ************************************ - - This module uses Dist::Zilla for development. This Makefile.PL will let you - run the tests, but should not be used for installation or building dists. - Building a dist should be done with 'dzil build', installation should be - done with 'dzil install', and releasing should be done with 'dzil release'. - - **************************************************************************** - -MESSAGE - $message =~ s/^(.*)$/\t\$(NOECHO) echo "$1";/mg; - } - - sub install { - return <export_to_level(1, @_); +} + +{ + package MY; + + use Config; + + my $message; + BEGIN { + $message = <<'MESSAGE'; + + ********************************* ERROR ************************************ + + This module uses Dist::Zilla for development. This Makefile.PL will let you + run the tests, but should not be used for installation or building dists. + Building a dist should be done with 'dzil build', installation should be + done with 'dzil install', and releasing should be done with 'dzil release'. + + **************************************************************************** + +MESSAGE + $message =~ s/^(.*)$/\t\$(NOECHO) echo "$1";/mg; + } + + sub install { + return <