Re: Fwd: Re: Apache::DBI as a prerequisite

2002-08-01 Thread Simon Perrault

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On July 30, 2002 10:02 pm, Stas Bekman wrote:
 2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html
 Though you can really rely on it once Apache::Test is released, which
 will happen when mod_perl 2.0 is released.
 1) That's an interesting problem. It seems that nobody has asked this
 question before. Here is my take on it. If you like this solution I'll
 add it to the docs.

Thanks a lot. Your solution for Apache::DBI works and is very Perlish!

- -- 
Simon Perreault [EMAIL PROTECTED]
Web: http://www.linuxquebec.com/~nomis80
PGP: $Web/nomis80.gpg
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9R94IqaCdwBMK2KkRAn9IAKCJ7UlIztV6MlThz8Y79b7+FbEGAQCZAdE+
3yP5wB/0udz2Rkgkvh+2S4U=
=ETSh
-END PGP SIGNATURE-



Re: Fwd: Re: Apache::DBI as a prerequisite

2002-07-31 Thread Stas Bekman

Simon Perrault wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On July 30, 2002 10:02 pm, Stas Bekman wrote:
 
2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html
Though you can really rely on it once Apache::Test is released, which
will happen when mod_perl 2.0 is released.
1) That's an interesting problem. It seems that nobody has asked this
question before. Here is my take on it. If you like this solution I'll
add it to the docs.
 
 
 Thanks a lot. Your solution for Apache::DBI works and is very Perlish!

Great. I've put it here:
http://perl.apache.org/docs/general/cpan_mod_dev/cpan_mod_dev.html


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Fwd: Re: Apache::DBI as a prerequisite

2002-07-30 Thread Stas Bekman

Simon Perreault wrote:

You wrote on 2002-04-30 to apache-modperl about Apache::DBI not being testable 
while not under mod_perl. You said this:



That's normal. You cannot test modules that use mod_perl API without 
running them inside mod_perl server. I've the same problem as you've 
reported. This test suite is simple broken.
...
All Apache:: module authors should be moving to use the new Apache::Test 
framework soon, since it lets you test the code under running mod_perl 
server and works with both versions of httpd/mod_perl.


This is exactly my situation. I develop a module which requires Apache::DBI, 
so I include it in my Makefile.PL like this:

WriteMakefile(
'PREREQ_PM'= {
'Apache::DBI'   = 0,
},
);

But that prints a warning because Apache::DBI can't find Apache::module(), 
which is only available under mod_perl.

My question:
1) Can you tell me (or guide me toward some information) how I can properly 
add Apache::DBI as a prerequisite so that it doesn't print a warning (which 
is the subjet of 90% of user emails)?
2) How can I test my module running Apache::DBI with Apache::Test?

I'll answer these in reverse:

2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html
Though you can really rely on it once Apache::Test is released, which 
will happen when mod_perl 2.0 is released.

1) That's an interesting problem. It seems that nobody has asked this 
question before. Here is my take on it. If you like this solution I'll 
add it to the docs.


Makefile.PL
---
use ExtUtils::MakeMaker;

# set prerequisites
my %prereq = (
 Foo = 1.56,
);

# Manually test whether Apache::DBI is installed and add it to the
# PREREQ_PM if it's not installed, so CPAN.pm will automatically fetch
# it. If Apache::DBI is already installed it will fail to get loaded by
# MakeMaker because it requires the mod_perl environment to load.
eval { require Apache::DBI };
if ($@  $@ !~ /Can't locate object method/) {
 $prereq{Apache::DBI} = '';
}

WriteMakefile(
 NAME   = 'Apache::SuperDuper',
 VERSION_FROM   = 'SuperDuper.pm',
 PREREQ_PM  = \%prereq,
 # ...
);




__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com