Hi! Please consider following me on twitter: @hanekomu.
2002年09月03日
Class::Null vs Class::BlackHole vs Class::Void
Oh dear. Before uploading or even writing Class::Null, as with any other class, I've searched CPAN for a module that would do what I needed. But Sean Burke's Class::BlackHole somehow escaped me. It seems to do pretty much what Class::Null does, except that Class::Null is even more minimalistic. Maybe I just scanned the list for things like 'Null' because I was thinking of the Null pattern…
And Class::Void isn't too dissimilar either. Oh well.
posted at: 10:44 | path: /dev | permalink | 0 comments | 0 trackbacks
Test::Distribution 1.02 (nee Comprehensive)
Andy Lester suggested to rename this module to Test::Distribution, which sounds a lot better than the old name (and might be more acceptable than "Test::Fascist" - sorry Dave :)). I've also updated the documentation with proper credits this time.
And Matt Sergeant asked for an option to specify only some of the functionality, e.g. only testing pod or only testing 'use'. So that's gone in as well.
Nice to see Open Source working; also read Andy Lester's journal entry.
I'm toying with the idea of adding an 'exports' test option which would go
through all of your module's exports (@EXPORT and
@EXPORT_OK) after loading it and making sure that there is a test
script for each of the exported symbols. *That* would have been really fascist,
but now that it's possible to turn certain functionality off…
posted at: 10:21 | path: /dev | permalink | 0 comments | 0 trackbacks
2002年09月02日
DBIx::Lookup::Field 1.2
And another release today. DBIx::Lookup::Field 1.2 adds
dbi_lookup_field_with_reverse(), which in addition to the lookup
hash, also gives you the reverse hash. Just a small convenience function.
Yes, I'm aware of what will happen if you have the same value several times in your original lookup hash. Yes, the function name is pretty long.
posted at: 19:43 | path: /dev | permalink | 0 comments | 0 trackbacks
Test::Comprehensive
Here's a little testing aid. It was inspired by brian d foy.
$ cat t/01comprehensive.t use Test::Comprehensive; $ make test ...
When using this module in a test script, it goes through all the modules in
your distribution, checks their POD, checks that they compile ok and checks
that they all define the same $VERSION.
It defines its own testing plan, so you can't use it in conjunction with
other Test::* modules in the same file. Therefore it's recommended
that you just create a one-line test script as shown above.
posted at: 19:16 | path: /dev | permalink | 0 comments | 0 trackbacks
Devel::SearchINC 1.2
I've updated Devel::SearchINC to use Test::More, added a
debugging option and resolved a small but somewhat irrelevant bug. And
documented it, of course. After changing email accounts several times, I'll
only use my @cpan.org mail address in module docs from now on.
This makes it much easier to redirect where the mails go to via the PAUSE web
interface.
posted at: 12:38 | path: /dev | permalink | 0 comments | 0 trackbacks
Exporter::Simple 1.00
At last I've updated Exporter::Simple. With perl 5.6.0,
there were no our attributes, and exporting lexicals involved
dealing with Filter::Simple and PadWalker and other nastiness. And it made the
Exporter::Simple code horribly complicated.
So with perl 5.8.0 out I did a total rewrite. We don't export globals, nor
do we need to export lexicals (which was a weird concept anyway). So there's no
need for Filter::Simple and PadWalker or any of the ugly workarounds that
introduced. And once it occurred to me that Exporter::Simple could just
subclass Exporter, and modules wanting to use Exporter::Simple could subclass
it, things were a lot easier. Now using the attributes will populate the
exporting package's @EXPORT, @EXPORT_OK and
%EXPORT_TAGS direcltly, and we let Exporter have its way (with a
few slight modifications).
It's beautiful. And more proof of the old adage "if it's too complicated, there's probably something wrong with it" - when it's right, it's rather simple and elegant and things easily fall into place.
posted at: 12:32 | path: /dev | permalink | 0 comments | 0 trackbacks