No Such thing as Moose-Zilla!

So the dilemma today is to decide what to call my next series I guess Dist-Pen would be an apt name and now to come up with some catchy titles and imags.

I spent a good little while looking at the fancy new (at least to me) distribution helpers out there and I have made a decision on which one I am going to use with accessor.

Well I have already abused 'ExtUtils::MakeMaker ' over the years so I will not lear much from playing with that one.

As for Module::Build I did play with that for a bit because it is Pure Perl and I have a Windows box but it did not play out the way I wanted. It will not get ne around the fact that I need an 'nmake' installed on my windows box. So I left this one in the dust.

Now Module::Install looked like a keeper until I started to read though the POD and test a few things and in the end I figured I was not gaining a whole lot by using it so I dropped that one off the list as well.

So that leaves me with the winner 'Dist::Zilla'. I am a little familiar with it, having done one other CPAN release with it. It does offer me the choices moving forward as I would really like my distribution process to be somewhat more automated. I like the idea that Dist::Zilla will take care of the downloading from gitub and automated deploying to CPAN.

Another feature I liked about Dist::Zilla is the ability to create profiles and plugins that allow to customize you distributions to a very high degree.

So lets get started with a few baby steps;

I first had to install it, which did take a little while, as it does have a dependancy tree that would knock you socks off and even on a fast Ubuntu box it can take 10 to 15min to install, so go out an get a coffee while you wait. Not sure how long it takes on a Windows box as I started it good half-hour before I started writing up today's post and it is still chugging along. Maybe it will bet done for tomorrow 's post.

Now the heart of any Dist:Zilla is the dist.ini file. I am not sure why they chose this format but at least I am familiar with it as I have been playing with these on Windows for nearly 30 years now, egad I am getting old.

Once that is done need to create the dist.ini in the top folder of my distribution and populate it with at least these fields

  • name
  • version
  • author
  • license
  • copyright_holder

I am not sure if the order means anything I will have to try that sometime.

So for my kick at the can I have


name = Database-Accessor
version = 0.01
author = John Scoles
license = Perl_5
copyright_holder = John Scoles

and to get this to work all I need to do is

$ dzil build
[DZ] beginning to build Database-Accessor
[DZ] guessing dist's main_module is lib/Database/Accessor.pm
[DZ] Unable to find main_module in the distribution
[DZ] We tried to guess 'lib/Database/Accessor.pm' but no file like that existed
[DZ] Upon further inspection we didn't find any files in your dist, did you add any?
[DZ] Cannot continue without a main_module
[DZ] Unable to find main_module in the distribution
[DZ] We tried to guess 'lib/Database/Accessor.pm' but no file like that existed
[DZ] Upon further inspection we didn't find any files in your dist, did you add any?
[DZ] Cannot continue without a main_module at /usr/local/lib/perl/5.18.2/Moose/Meta/Method/Delegation.pm line 110.

Neat that it is trying to guess what to do and how it is telling me what I am missing so I will add that in

main_module = lib/Database/Accesor.pm

but if I try and build again I will get the same fail. What I have to do is add in a Dist::Zilla plugin to gather up all my files so I also need to add

[GatherDir]

and when I try to build again I get

[DZ] beginning to build Database-Accessor
Unable to extract an abstract from lib/Database/Accessor.pm. Please add the following comment to the file with your abstract:
# ABSTRACT: turns baubles into trinkets

So I am off to the races.

The Incredible Mounted Cat Moose Costume 19.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations