Dist::Zilla

Hans Dieter Pearcey (hdp@cpan.org)

Dist::Zilla

rawr

Distributing Code on CPAN

Distributing Code on CPAN

Ninja.pm

before

after

dist.ini

version = 0.001
license = Perl_5
author = Someone <someone@somewhere.com>
copyright_holder = Someone

dist.ini

version = 0.001
license = Perl_5
author = Someone <someone@somewhere.com>
copyright_holder = Someone

[PodPurler]

PodPurler

package Foo;
# ABSTRACT: things a smurfy smurf would smurf

=attr x

=method y
=head1 NAME

Foo - things a smurfy smurf would smurf

=head1 ATTRIBUTES

=head2 x

=head1 METHODS

=head2 y

=head1 AUTHOR

Someone C<< <someone@somewhere.com> >>

=head1 COPYRIGHT & LICENSE

<license text>

PodPurler's future

How PodPurler Works

Secret Sauce

$self->plugins_with($role_name)

e.g. from Dist::Zilla

$_->munge_files for $self->plugins_with(-FileMunger);

from Dist::Zilla::App::Command::release

my $tgz = $self->zilla->build_archive;
$_->release($tgz) for $self->plugins_with(-Releaser);

(More) Secret Sauce

Dist::Zilla::Role::FileMunger

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

$self->munge_file($_) for $self->zilla->files;
}

(Even More) Secret Sauce

Dist::Zilla::Plugin::PodPurler

sub munge_file {
my ($self, $file) = @_;

return $self->munge_pod($file)
if $file->name =~ /\.(?:pm|pod)$/i
and ($file->name !~ m{/}
or $file->name =~ m{^lib/});

return;
}

Standard Plugins

Core Dist-Building Roles

Helper Roles

simple dist.ini

name    = MooseX-InsideOut
version = 0.103
license = Perl_5
author  = Hans Dieter Pearcey <hdp@cpan.org>
copyright_holder = Hans Dieter Pearcey <hdp@cpan.org>

[Prereq]
Class::MOP = 0.80
Moose = 0.73
Hash::Util::FieldHash::Compat = 0
namespace::clean = 0.11

[@Classic]

[PodPurler]

Plugin Bundles

[@Filter]
bundle = @Classic
remove = PodVersion

Existing Projects

name    = MyApp
version = 1.001
author  = Your Name
copyright_holder = Your Name

Releaser

package MyReleaseCycle;

use Moose;
with 'Dist::Zilla::Plugin::Releaser';

sub release {
my ($self, $tgz) = @_;
my $tag = 'release_' . $self->zilla->version;
system('git', 'tag', $tag) && die "git tag failed";
}

in dist.ini

[=MyReleaseCycle]

the end

thank you!

rawr