Entering MooseX: XX Even more Xes

Well looking at my next victim on the list and so I was going to have a look at Dist::Maker. Well sorry to say this one seems out of the running very early on. As from what I have discovered on its documentation it is really is just for creating distributions from scratch. Pity as I already have most of my dist done so I will just play that I haven't done that part yet and see what I come up with

Well it did install smoothly even though I used a new clean version of Perl it only took a few mins compared to the over 45 for Dist::Zilla on a box that had a good number of prerequisites to begin with.

The Mod itself is sparsely documented but then again it is very simple stuff so that is not too many points off, One thing I did like where the examples that are included as they helped out some what.

So to start one has to register a few con-fig values and like Dist::Zilla it has its own command line tool called 'dim' and we can get the list of commads just by doing this

Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/Dwi
perl/perl/site/lib/Dist/Maker/Config.pm line 60.
# set your name and email address first
dim config user.name 'foo bar'
dim config user.email 'foo at example.com'
# or import user info from $HOME/.gitconfig
dim config --import-from-gitconfig

# then make distributions
dim init Foo::Bar # creates a distribution
dim init Foo::Bar Default # ditto
dim init Foo::Bar::XS XS # using D::M::Template::XS
dim --verbose=4 init Foo::Bar # with verbosity
dim init --force Foo::Bar # do `rm -rf Foo-Bar` before init
dim init --dry-run Foo::Bar # don't actially init the dist

# cd and do something important
cd Foo-Bar/

# add new files
dim new Baz.pm # creates lib/Foo/Bar/Baz.pm
dim new t/001-basic.t # creates a test file
dim new xs/Foo-Bar-Baz.xs XS # creates a file with D::M::Template::XS

Now I should say you might of noticed at the top of the above the

Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/Dwi
perl/perl/site/lib/Dist/Maker/Config.pm line 60.

So some pointers on this undocumented tidbit. You really have to set this ENV values to have the system work properly and it is a real pity it is not in the docs someplace.

so here we go

>set HOME=D:\blogs\
>dim config user.name 'John P Scoles'
>>dim config user.email 'byterock@hotmail.com'

Well ok but would be nice to get some sort of info back telling me something actually happened. So next lets create my Dist from scratch

I start with

dim init MooseX::AuthorizedMethodRoles
D:\blogs\MooseX-AuthorizedMethodRoles\lib\MooseX>dim init MooseX::AuthorizedMet
>> Command::init: running with MooseX::AuthorizedMethodRoles Default ...
>> Template::Default: perl.exe Makefile.PL
>> Template::Default: perl.exe -MExtUtils::Manifest=mkmanifest -e mkmanifest

and after a few mins of huffing and puffing I get my dist all nicely set, a whack of default files two test (well very basic but a start) and an empty 'AuthorizedMetodRoles.pm' and, as I suspected it would, it did give me something I did not want a directory called 'AuthorizedMetodRoles'.

Well lets see if I can add my other files

D:\blogs>dim new Moosex::Meta::Role::Authorize
>> Command::new: running with Moosex/Meta/Role/Authorize.pm Default in blogs
>> Command::new: create lib/blogs/Moosex/Meta/Role/Authorize.pm from lib/blogs.pm

>> Command::new: finished.

and a quick look there is my empty file .pm however it is in the wrong place so I guess I have to move into the 'AuthorizedMethodRoles' dir and give it a go

D:\blogs\MooseX-AuthorizedMethodRoles>dim new Moosex::Meta::Role::Authorize
>> Command::new: running with Moosex/Meta/Role/Authorize.pm Default in MooseX-AuthorizedMethodRoles
>> Command::new: create lib/MooseX/AuthorizedMethodRoles/Moosex/Meta/Role/Authorize.pm from lib/MooseX/AuthorizedMethodRoles.pm
>> Command::new: finished.

and again in the wrong spot.

Well 30mins later I was not close to a solution so I though I would leave it there for tonight.

No use wasting any more time, it does do a good job on the simple stuff but I just can't seem to bend it to my will so not second thoughts on this one. The temperating part is good and I may use this if I was doing another Moos mod from scratch a long as it was a simple 1 directory one.


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