Dist-Zilla-Role-PluginBundle-Zilla

 view release on metacpan or  search on metacpan

lib/Dist/Zilla/Role/PluginBundle/Zilla.pm  view on Meta::CPAN

use strict;
use warnings;

our $VERSION = '0.001';

use Moose::Role;
with 'Dist::Zilla::Role::PluginBundle';

use List::Util qw(first);
use Moose::Util::TypeConstraints qw(class_type);
use Scalar::Util qw(weaken);

use namespace::autoclean;

has name => (
    is       => 'ro',
    isa      => 'Str',
    required => 1,
);

has zilla => (

lib/Dist/Zilla/Role/PluginBundle/Zilla.pm  view on Meta::CPAN

    my %zilla;

    around 'register_component' => sub {
        my ( $orig, $class, $name, $arg, $section ) = @_;

        my @sections       = $section->sequence->sections;
        my ($root_section) = first { $_->name eq q{_} } @sections;
        my $zilla          = $root_section->zilla;

        $zilla{$name} = $zilla;
        weaken( $zilla{$name} );

        return $class->$orig( $name, $arg, $section );
    };

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

        my $name = $self->name;

        my $zilla = delete $zilla{$name};



( run in 0.361 second using v1.01-cache-2.11-cpan-65fba6d93b7 )