Subject: | Split metafile generation into user overridable methods. |
Adriano Ferreira wrote:
Show quoted text
> The following patch extends EXTRA_META to accept hash refs as well it
> already accepts YAML-formatted text.
>
> This way I could write a Makefile.PL like
>
> use 5.006;
> use ExtUtils::MakeMaker;
>
> WriteMakefile(
> NAME => 'Foo',
> VERSION => '42',
> EXTRA_META => {
> recommends => {
> 'Test::Pod' => '1.18',
> 'Test::Pod::Coverage' => '1.04',
> }
> }
>
> );
This is a much better idea than my "paste this onto the end of the
META.yml" which makes my feet itch and I'm going to undocument right now
so it doesn't hold up 6.31.
Probably even better is to simply expose the META.yml hash generation
method and allow the user to override. metafile_data() would simply
return the data which MakeMaker then turns into a META.yml file.
metafile_file() would take that and turn it into a file.
metafile_target would simply do the necessary make juju to paste the
metafile_file into the Makefile target.
This has the nice side-effect of MakeMaker not having to depend on
META.yml. It can continue to use its crappy fake YAML generator and if
you write a metafile_data() that does something more complicated you can
override metafile_file() to use YAML.pm.
I'm not holding up 6.31 for this, but its a very good idea. Patches
welcome.