2010-08-13

supply your own perlcriticrc to dzil test plugin

if you wanted the ability to supply your own perlcriticrc while using dist-zilla-plugin-critictests, then stephen scaffidi is your hero of the day. indeed, he just implemented this - and i had to do the tedious work of typing "dzil release". oh well, i can say that life is difficult. :-)

2010-07-29

perl's state in mandriva cooker

some time after mandriva 2010.1 has been released, i'm now pleased to report that perl has been updated to 5.12.1, all cpan modules are up-to-date (including padre 0.68) or bugs have been reported upstream... and parrot 2.6.0 is currently building.

the perl 5.12.0 - 5.12.1 upgrade was really smooth: no patch to rediff, reapply, etc. that's definitely a good thing for perl maintainers to have a stable series with only critical fixes going in. i've already said it, but thanks again to p5p!

2010-06-16

announcing file::sharedir::pathclass

following last week's announce of file::homedir::pathclas, i also committed file::sharedir::pathclass on the same principle. therefore, if you always wrap file::sharedir results in path::class objects for greater convenience, just use file::sharedir::pathclass instead, which is doing that automatically for you.

2010-06-11

random file-homedir bits

no need to present file::homedir, the module to use to retrieve various information such as where is my home, where is my desktop, where are my documents, etc.

since my needs were not all covered, i contacted alias with some of my ideas. he kindly gave me a commit bit so i can scratch my itches at will...

i therefore implemented xdg support for recent unix desktops, with daxim's help. this means that unix platforms with gnome, kde or any recent desktops won't report $HOME as the one and unique answer to all those questions. this feature is available in released file-homedir 0.91 - towards a cleaning of our homedirs, yay!

still in the work (not yet released), i've also checked in a my_dist_data($dist) function, to standardize the directory where the application will store its internal data, such as database or cache. it is located in:
my_data()/Perl/dist/$dist
following the now traditional data/vendor/application scheme (on legacy unix desktops, the directory will be $HOME/.perl/dist/$dist/var, to be sure that it's a hidden directory). to be consistent with file::sharedir, i guess i'll also implement my_module_data($module), following the same reasoning.

this will likely be released in version 0.92, before working on the last remaining bit on my plate: my_dist_config($dist), returning a directory where an application will be able to store its configuration. it's a bit different of the data directory (even if config is some kind of data): data is supposed to be transient, or can be removed without harming the app - while the config should not be erased. however, it's not really as straightforward as the data directory, since not all platforms support this: on windows, users are not supposed to update config by hand, so it's often stored in the registry... so how to preserve the cross-distribution nature of file-homedir for this very feature? this will require some thinking...

finally, it's with great pleasure that i'm announcing file-homedir-pathclass, which is a convenient wrapper around file-homedir returning path::class objects. alias did not want to introduce it in file-homedir to preserve compatibility, and suggested to release it as a new dist... so i released this new module, allowing to write for example:
perl -MFile::HomeDir::PathClass=-all -E 'say $_ for my_home()->children'

2010-06-08

how to retrieve image size in perl

today's topic is quite easy: retrieving image size (in perl, with the help of cpan of course). indeed, when one wants to resize an image, it's often interesting to know its current size.

the easiest way to retrieve those information is of course to use image::size:

easy, wasn't it?

however, as mentioned previously, retrieving those information is often just the prelude before doing some transformation to the image itself. and image::size, while doing it perfectly, does only one thing - it cannot be used for any other image manipulation. so if you intend to use another module after, you can as well use this other module to retrieve this information: that'll be faster (image read only once) and use less memory (only one module loaded). here's how to get those information with image::magick:

it wasn't that difficult, and opens the whole image magick world to your program!

2010-05-31

further prisk enhancements

imagine a world map. now show me on the map where china is - easy, uh? where is irkustk? tougher, isn't it? but it remains a region which exists in our world... now imagine we have another map in front of us... a map named godstorm for example... where is thule? or poseidonis?

those questions aren't rethorical, when playing prisk. because, when you exchange 3 cards to get reinforcements, you also get bonuses if you exchange a card representing a country that you own. and if it's easy to check at a glance if you own china when playing classical risk map, it's another challenge to locate thule on godstorm map.

therefore, i'm glad to introduce latest prisk version (3.101510, currently on its way to cpan). in the card window, one can now double-click a card, and this will highlight a country on the big map. this way, you'll know exactly which card to exchange (or what country to invade) in order to maximize your reinforcements. happy invasion!

(remember that i'm always welcoming code contribution or new translations)

2010-05-24

new continent window for prisk

some further enhancements to prisk: latest version got a brand new continent window, listing the continents, their bonus, and who owns the countries. it also highlights when a continent is totally owned by a player. it is also updated during the game, when players gain and loose countries.

without further ado, here's a snapshot of the new shiny feature:

also new in version 3.101430, the ability to run prisk directly from the checkout. previously one would need to run "dzil run ./bin/prisk" since file::sharedir requires a fully built + installed distribution before finding its stuff. now, prisk detects if it's running in a local checkout, and will bypass file::sharedir.

the code is on github where you can fork it: patches and translations welcome!