Dist::Zilla::Plugin::MetaConfig - summarize Dist::Zilla configuration into distmeta


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

Index


Code Index:

NAME

Top

Dist::Zilla::Plugin::MetaConfig - summarize Dist::Zilla configuration into distmeta

VERSION

Top

version 4.200008

DESCRIPTION

Top

This plugin adds a top-level x_Dist_Zilla key to the distmeta for the distribution. It describe the Dist::Zilla version used as well as all the plugins used. Each plugin's name, package, and version will be included. Plugins may augment their implementation of the Dist::Zilla::Role::ConfigDumper role methods to add more data to this dump.

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

package Dist::Zilla::Plugin::MetaConfig;
BEGIN {
  $Dist::Zilla::Plugin::MetaConfig::VERSION = '4.200008';
}
# ABSTRACT: summarize Dist::Zilla configuration into distmeta
use Moose;
with 'Dist::Zilla::Role::MetaProvider';


sub metadata {
  my ($self) = @_;

  my $dump = { };

  my @plugins;
  $dump->{plugins} = \@plugins;

  my $config = $self->zilla->dump_config;
  $dump->{zilla} = {
    class   => $self->zilla->meta->name,
    version => $self->zilla->VERSION,
      (keys %$config ? (config => $config) : ()),
  };

  for my $plugin (@{ $self->zilla->plugins }) {
    my $config = $plugin->dump_config;

    push @plugins, {
      class   => $plugin->meta->name,
      name    => $plugin->plugin_name,
      version => $plugin->VERSION,
      (keys %$config ? (config => $config) : ()),
    };
  }

  return { x_Dist_Zilla => $dump };
}

no Moose;
__PACKAGE__->meta->make_immutable;
1;

__END__