On Sun, Jun 07, 2009 at 12:42:37PM +0100, System Monitoring wrote: > My first post here, so Hi. > > I have (my first) module for cpan and to try and avoid some "obvious" > newbie mistakes ... a couple of questions: > > I'm using App::Cache, which creates a .$dir in the users > File::HomeDir. Running the tests of App::Cache leaves > ~/.app_cache_test lingering in the filesystem. For my module > App::Cache would create ~/.parse_cpan_cached_test > > Should I (a) reporting the lingering dir as a bug (and offer a patch?)
No, cos it doesn't sound like a bug! > (b) ignore the fact the tests leave directories lingering around No, because it's both wasteful of disk space and could potentially lead to confusing or incorrect test results if the tests are run twice. > (c) try and clean up after myself Yes. Here's a Makefile.PL snippet which modifies what happens at 'make test' time: http://www.cantrell.org.uk/cgit/cgit.cgi/perlmodules/commit/?id=0297f53afe8f2d7b2d8ca93fd34fcb154e663e80 In this case it *pre*pends some stuff, but adapting it to *ap*pend and so delete the cache directory after testing shouldn't be difficult. If you want to be portable you'll need to use perl to do the deletion and not 'rm -rf', and will need to use $Config{perlpath}.$Config{_exe}. See 'perldoc Config', 'perldoc ExtUtils::MakeMaker' and read a EU::MM- generated Makefile for details. > The problem with (c) is that App::Cache doesn't have a documented > method for extracting the directory in question. It does have a > (undocumented) $app_cache->directory which appears to be the right > thing. Hmmm, in that case, why not submit a patch to the author that simply documents that method? Possible also a test for it too if he doesn't aready have one. > My app needs a mysql db setup so I'm not sure how to go about flagging > that dependency and/or how to deal with the "mysqladmin create > db_name" & granting user permissions, other than in a README. I'm > using DBIx::Class, so I can deploy the schema in code, but the db > setup less so. Look at Test::Database. > ps. It did occur that this module is perhaps too simple as to not > warrant being on cpan. Certainly not! There's lots of very simple, very useful modules on the CPAN. -- David Cantrell | A machine for turning tea into grumpiness All children should be aptitude-tested at an early age and, if their main or only aptitude is for marketing, drowned.