You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2004/07/07 16:01:25 UTC

Apache-Test module skeletons

hi all...

the bug reporting skeleton has become so useful for me (and others) that I
have created two new skeletons:

  http://perl.apache.org/~geoff/Apache-Test-skeleton-mp1.tar.gz
  http://perl.apache.org/~geoff/Apache-Test-skeleton-mp2.tar.gz

these are essentially the same as the bug reporting skeletons but geared
toward new module development - a basic handler exists in
lib/Apache/Handler.pm, references to "bugs" have been removed, etc.

enjoy.

--Geoff

Re: Apache-Test module skeletons

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> Geoff, did you get all that? ;-)

kinda.  I'll roll up a candidate for this next week and let you add/tweak
the appropriate Build.PL before I release it into the wild.

--Geoff

Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:
> 
>> There is no Apache.pm in mp2. You probably wanted to say:
>>
>> >     requires       => { 'mod_perl'   => 0,
> 
> 
> Right. In fact, it should probably be
> 
>     requires       => { 'mod_perl'   => '1.0',
> 
> in the MP1 example, and
> 
>     requires       => { 'mod_perl'   => '1.99',
> 
> in the MP2 example, yes?

That's right. But better do it:

 >     requires       => { 'mod_perl'   => '1.9914',

to show how to require 1.99_14,



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> Geoff, did you get all that? ;-)

kinda.  I'll roll up a candidate for this next week and let you add/tweak
the appropriate Build.PL before I release it into the wild.

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 9, 2004, at 2:23 PM, Stas Bekman wrote:
> 
>> I don't know how M::B does the version checking, but EU::MM does file 
>> parsing, searching for the $VERSION line, so the version number must 
>> be hardcoded there, unless you do something like:
>>
>> $VERSION = do { require Apache2; require mod_perl.pm; 
>> $mod_perl::VERSION }
> 
> 
> Module::Build uses the same approach. I think that the efforts were 
> synchronized here.

This patch adds that functionality to mp2:

Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.164
diff -u -r1.164 Build.pm
--- lib/Apache/Build.pm 4 Jul 2004 18:44:49 -0000       1.164
+++ lib/Apache/Build.pm 9 Jul 2004 22:05:56 -0000
@@ -1752,7 +1752,12 @@
  sub generate_apache2_pm {
      my $self = shift;

-    my $fixup = !$self->{MP_INST_APACHE2}
+    my $fixup = << 'EOF';
+our $VERSION = do { require Apache2; require mod_perl; 
$mod_perl::VERSION };
+
+EOF
+
+    $fixup .= !$self->{MP_INST_APACHE2}
          ? '# MP_INST_APACHE2=0, do nothing'
          : <<'EOF';
  BEGIN {

it's a bit wicked that Apache2 requires itself:

package Apache2;
our $VERSION = do { require Apache2; require mod_perl; $mod_perl::VERSION };

but it's needed to find the right mod_perl.pm. May be a comment is due.

PAUSE and any tools based on ExtUtils::MakeMaker version parser should 
be happy:

% perl -Mblib -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' 
lib/Apache2.pm
1.9915

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 9, 2004, at 2:23 PM, Stas Bekman wrote:
> 
>> I don't know how M::B does the version checking, but EU::MM does file 
>> parsing, searching for the $VERSION line, so the version number must 
>> be hardcoded there, unless you do something like:
>>
>> $VERSION = do { require Apache2; require mod_perl.pm; 
>> $mod_perl::VERSION }
> 
> 
> Module::Build uses the same approach. I think that the efforts were 
> synchronized here.

This patch adds that functionality to mp2:

Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.164
diff -u -r1.164 Build.pm
--- lib/Apache/Build.pm 4 Jul 2004 18:44:49 -0000       1.164
+++ lib/Apache/Build.pm 9 Jul 2004 22:05:56 -0000
@@ -1752,7 +1752,12 @@
  sub generate_apache2_pm {
      my $self = shift;

-    my $fixup = !$self->{MP_INST_APACHE2}
+    my $fixup = << 'EOF';
+our $VERSION = do { require Apache2; require mod_perl; 
$mod_perl::VERSION };
+
+EOF
+
+    $fixup .= !$self->{MP_INST_APACHE2}
          ? '# MP_INST_APACHE2=0, do nothing'
          : <<'EOF';
  BEGIN {

it's a bit wicked that Apache2 requires itself:

package Apache2;
our $VERSION = do { require Apache2; require mod_perl; $mod_perl::VERSION };

but it's needed to find the right mod_perl.pm. May be a comment is due.

PAUSE and any tools based on ExtUtils::MakeMaker version parser should 
be happy:

% perl -Mblib -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' 
lib/Apache2.pm
1.9915

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 2:23 PM, Stas Bekman wrote:

> I don't know how M::B does the version checking, but EU::MM does file 
> parsing, searching for the $VERSION line, so the version number must 
> be hardcoded there, unless you do something like:
>
> $VERSION = do { require Apache2; require mod_perl.pm; 
> $mod_perl::VERSION }

Module::Build uses the same approach. I think that the efforts were 
synchronized here.

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 2:23 PM, Stas Bekman wrote:

> I don't know how M::B does the version checking, but EU::MM does file 
> parsing, searching for the $VERSION line, so the version number must 
> be hardcoded there, unless you do something like:
>
> $VERSION = do { require Apache2; require mod_perl.pm; 
> $mod_perl::VERSION }

Module::Build uses the same approach. I think that the efforts were 
synchronized here.

David


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Fri, 9 Jul 2004, Stas Bekman wrote:
> 
> 
>>Randy Kobes wrote:
> 
> [ ... ]
> 
>>>What about requiring 'Apache' for mp1-related modules
>>>(since 'Apache' doesn't exist within mp2), and for mp2
>>>modules, requiring 'Apache2' (which doesn't exist within
>>>mp1)?
>>
>>It won't work since the version number lives in the
>>package mod_perl.  and most likely you'd want to require a
>>minimal version at some point.
> 
> 
> That's true - I forgot about that ... One could tie the
> version of Apache.pm (for mp1) or Apache2.pm (for mp2) to
> the corresponding mod_perl.pm version, and make a note of
> that in the RELEASE notes, but I agree, that's not
> addressing the underlying issue.

I don't know how M::B does the version checking, but EU::MM does file 
parsing, searching for the $VERSION line, so the version number must be 
hardcoded there, unless you do something like:

$VERSION = do { require Apache2; require mod_perl.pm; $mod_perl::VERSION }

since EU::MM is going to run that in eval STRING. I thikn CPAN.pm does 
the same, not sure about CPANPLUS.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Fri, 9 Jul 2004, Stas Bekman wrote:
> 
> 
>>Randy Kobes wrote:
> 
> [ ... ]
> 
>>>What about requiring 'Apache' for mp1-related modules
>>>(since 'Apache' doesn't exist within mp2), and for mp2
>>>modules, requiring 'Apache2' (which doesn't exist within
>>>mp1)?
>>
>>It won't work since the version number lives in the
>>package mod_perl.  and most likely you'd want to require a
>>minimal version at some point.
> 
> 
> That's true - I forgot about that ... One could tie the
> version of Apache.pm (for mp1) or Apache2.pm (for mp2) to
> the corresponding mod_perl.pm version, and make a note of
> that in the RELEASE notes, but I agree, that's not
> addressing the underlying issue.

I don't know how M::B does the version checking, but EU::MM does file 
parsing, searching for the $VERSION line, so the version number must be 
hardcoded there, unless you do something like:

$VERSION = do { require Apache2; require mod_perl.pm; $mod_perl::VERSION }

since EU::MM is going to run that in eval STRING. I thikn CPAN.pm does 
the same, not sure about CPANPLUS.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, Stas Bekman wrote:

> Randy Kobes wrote:
[ ... ]
> > What about requiring 'Apache' for mp1-related modules
> > (since 'Apache' doesn't exist within mp2), and for mp2
> > modules, requiring 'Apache2' (which doesn't exist within
> > mp1)?
>
> It won't work since the version number lives in the
> package mod_perl.  and most likely you'd want to require a
> minimal version at some point.

That's true - I forgot about that ... One could tie the
version of Apache.pm (for mp1) or Apache2.pm (for mp2) to
the corresponding mod_perl.pm version, and make a note of
that in the RELEASE notes, but I agree, that's not
addressing the underlying issue.

-- 
best regards,
randy


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 9, 2004, at 2:03 PM, Randy Kobes wrote:
> 
>> But won't the CPAN indices (which are used by both CPAN.pm
>> and CPANPLUS.pm) still just recognize one version of
>> mod_perl.pm? Either the current one associated with mp1, or,
>> when mp2 is out of development, that associated with mp2
>> (assuming mod_perl.pm of mp2 has a higher version compared
>> to that of mp1). Or will CPANPLUS go beyond the CPAN
>> indices?
> 
> 
> That I don't know. I would ask the CPANPLUS developers.
> 
>   http://cpanplus.sourceforge.net/

It won't. Since PAUSE index doesn't contain anything, but the latest 
version. So the syntax sugar of M::B is not quite helpful to satisfy the 
dependencies at the moment.

>> One (qualitatively similar) example is the GD module, for
>> which there's two major (incompatible) versions, 1 and 2.
>> Currently CPAN.pm reports GD as being version 2.12, and so
>> to install an earlier version 1.x, you have to tell CPAN.pm
>> explicitly which distribution you want to install.
> 
> 
> Right, the indexing is still a problem. However, for those who have the 
> proper mp installed already, it should just work. And for those who 
> don't, installation should fail, but they'll be told why.
> 
> But I agree that the indexing issue is important. Perhaps there should 
> be a META.yml rule to tell CPAN what to index, so as to keep track of 
> older versions of modules for those that really need to?

There is no such support yet. Even though it was discussed long, long, 
long time ago.

> I dunno. Something to ask Jarkko about.

That would probably be Andreas and Autrijus.



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 9, 2004, at 2:03 PM, Randy Kobes wrote:
> 
>> But won't the CPAN indices (which are used by both CPAN.pm
>> and CPANPLUS.pm) still just recognize one version of
>> mod_perl.pm? Either the current one associated with mp1, or,
>> when mp2 is out of development, that associated with mp2
>> (assuming mod_perl.pm of mp2 has a higher version compared
>> to that of mp1). Or will CPANPLUS go beyond the CPAN
>> indices?
> 
> 
> That I don't know. I would ask the CPANPLUS developers.
> 
>   http://cpanplus.sourceforge.net/

It won't. Since PAUSE index doesn't contain anything, but the latest 
version. So the syntax sugar of M::B is not quite helpful to satisfy the 
dependencies at the moment.

>> One (qualitatively similar) example is the GD module, for
>> which there's two major (incompatible) versions, 1 and 2.
>> Currently CPAN.pm reports GD as being version 2.12, and so
>> to install an earlier version 1.x, you have to tell CPAN.pm
>> explicitly which distribution you want to install.
> 
> 
> Right, the indexing is still a problem. However, for those who have the 
> proper mp installed already, it should just work. And for those who 
> don't, installation should fail, but they'll be told why.
> 
> But I agree that the indexing issue is important. Perhaps there should 
> be a META.yml rule to tell CPAN what to index, so as to keep track of 
> older versions of modules for those that really need to?

There is no such support yet. Even though it was discussed long, long, 
long time ago.

> I dunno. Something to ask Jarkko about.

That would probably be Andreas and Autrijus.



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 2:03 PM, Randy Kobes wrote:

> But won't the CPAN indices (which are used by both CPAN.pm
> and CPANPLUS.pm) still just recognize one version of
> mod_perl.pm? Either the current one associated with mp1, or,
> when mp2 is out of development, that associated with mp2
> (assuming mod_perl.pm of mp2 has a higher version compared
> to that of mp1). Or will CPANPLUS go beyond the CPAN
> indices?

That I don't know. I would ask the CPANPLUS developers.

   http://cpanplus.sourceforge.net/

> One (qualitatively similar) example is the GD module, for
> which there's two major (incompatible) versions, 1 and 2.
> Currently CPAN.pm reports GD as being version 2.12, and so
> to install an earlier version 1.x, you have to tell CPAN.pm
> explicitly which distribution you want to install.

Right, the indexing is still a problem. However, for those who have the 
proper mp installed already, it should just work. And for those who 
don't, installation should fail, but they'll be told why.

But I agree that the indexing issue is important. Perhaps there should 
be a META.yml rule to tell CPAN what to index, so as to keep track of 
older versions of modules for those that really need to?

I dunno. Something to ask Jarkko about.

Regards,

David


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 2:03 PM, Randy Kobes wrote:

> But won't the CPAN indices (which are used by both CPAN.pm
> and CPANPLUS.pm) still just recognize one version of
> mod_perl.pm? Either the current one associated with mp1, or,
> when mp2 is out of development, that associated with mp2
> (assuming mod_perl.pm of mp2 has a higher version compared
> to that of mp1). Or will CPANPLUS go beyond the CPAN
> indices?

That I don't know. I would ask the CPANPLUS developers.

   http://cpanplus.sourceforge.net/

> One (qualitatively similar) example is the GD module, for
> which there's two major (incompatible) versions, 1 and 2.
> Currently CPAN.pm reports GD as being version 2.12, and so
> to install an earlier version 1.x, you have to tell CPAN.pm
> explicitly which distribution you want to install.

Right, the indexing is still a problem. However, for those who have the 
proper mp installed already, it should just work. And for those who 
don't, installation should fail, but they'll be told why.

But I agree that the indexing issue is important. Perhaps there should 
be a META.yml rule to tell CPAN what to index, so as to keep track of 
older versions of modules for those that really need to?

I dunno. Something to ask Jarkko about.

Regards,

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, David Wheeler wrote:

> On Jul 9, 2004, at 1:45 PM, David Wheeler wrote:
>
> > use 5.00503;
> > use Apache::TestMB;
> >
> > Apache::TestMB->new(
> >     module_name    => 'Apache::Test::Skeleton',
> >     license        => 'perl',
> >     requires       => { 'mod_perl'   => ">= 1.0, < 1.99",
> >                       },
> >     build_requires => { Test::More => 0,
> >                       },
> > )->create_build_script;
>
> Oh, and FWIW, CPANPLUS should soon have the ability to check such a
> spec. Not sure that CPAN.pm ever will, though.
>
> Regards,
>
> David

But won't the CPAN indices (which are used by both CPAN.pm
and CPANPLUS.pm) still just recognize one version of
mod_perl.pm? Either the current one associated with mp1, or,
when mp2 is out of development, that associated with mp2
(assuming mod_perl.pm of mp2 has a higher version compared
to that of mp1). Or will CPANPLUS go beyond the CPAN
indices?

One (qualitatively similar) example is the GD module, for
which there's two major (incompatible) versions, 1 and 2.
Currently CPAN.pm reports GD as being version 2.12, and so
to install an earlier version 1.x, you have to tell CPAN.pm
explicitly which distribution you want to install.

-- 
best regards,
randy

Re: Apache-Test module skeletons

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, David Wheeler wrote:

> On Jul 9, 2004, at 1:45 PM, David Wheeler wrote:
>
> > use 5.00503;
> > use Apache::TestMB;
> >
> > Apache::TestMB->new(
> >     module_name    => 'Apache::Test::Skeleton',
> >     license        => 'perl',
> >     requires       => { 'mod_perl'   => ">= 1.0, < 1.99",
> >                       },
> >     build_requires => { Test::More => 0,
> >                       },
> > )->create_build_script;
>
> Oh, and FWIW, CPANPLUS should soon have the ability to check such a
> spec. Not sure that CPAN.pm ever will, though.
>
> Regards,
>
> David

But won't the CPAN indices (which are used by both CPAN.pm
and CPANPLUS.pm) still just recognize one version of
mod_perl.pm? Either the current one associated with mp1, or,
when mp2 is out of development, that associated with mp2
(assuming mod_perl.pm of mp2 has a higher version compared
to that of mp1). Or will CPANPLUS go beyond the CPAN
indices?

One (qualitatively similar) example is the GD module, for
which there's two major (incompatible) versions, 1 and 2.
Currently CPAN.pm reports GD as being version 2.12, and so
to install an earlier version 1.x, you have to tell CPAN.pm
explicitly which distribution you want to install.

-- 
best regards,
randy

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 1:45 PM, David Wheeler wrote:

> use 5.00503;
> use Apache::TestMB;
>
> Apache::TestMB->new(
>     module_name    => 'Apache::Test::Skeleton',
>     license        => 'perl',
>     requires       => { 'mod_perl'   => ">= 1.0, < 1.99",
>                       },
>     build_requires => { Test::More => 0,
>                       },
> )->create_build_script;

Oh, and FWIW, CPANPLUS should soon have the ability to check such a 
spec. Not sure that CPAN.pm ever will, though.

Regards,

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 1:45 PM, David Wheeler wrote:

> use 5.00503;
> use Apache::TestMB;
>
> Apache::TestMB->new(
>     module_name    => 'Apache::Test::Skeleton',
>     license        => 'perl',
>     requires       => { 'mod_perl'   => ">= 1.0, < 1.99",
>                       },
>     build_requires => { Test::More => 0,
>                       },
> )->create_build_script;

Oh, and FWIW, CPANPLUS should soon have the ability to check such a 
spec. Not sure that CPAN.pm ever will, though.

Regards,

David


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 1:38 PM, Stas Bekman wrote:

> It won't work since the version number lives in the package mod_perl. 
> and most likely you'd want to require a minimal version at some point.

Ah, but this is one of the beauties of Module::Build, my friends. 
Behold!

use 5.00503;
use Apache::TestMB;

Apache::TestMB->new(
     module_name    => 'Apache::Test::Skeleton',
     license        => 'perl',
     requires       => { 'mod_perl'   => ">= 1.0, < 1.99",
                       },
     build_requires => { Test::More => 0,
                       },
)->create_build_script;

:-)

David


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 1:38 PM, Stas Bekman wrote:

> It won't work since the version number lives in the package mod_perl. 
> and most likely you'd want to require a minimal version at some point.

Ah, but this is one of the beauties of Module::Build, my friends. 
Behold!

use 5.00503;
use Apache::TestMB;

Apache::TestMB->new(
     module_name    => 'Apache::Test::Skeleton',
     license        => 'perl',
     requires       => { 'mod_perl'   => ">= 1.0, < 1.99",
                       },
     build_requires => { Test::More => 0,
                       },
)->create_build_script;

:-)

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, Stas Bekman wrote:

> Randy Kobes wrote:
[ ... ]
> > What about requiring 'Apache' for mp1-related modules
> > (since 'Apache' doesn't exist within mp2), and for mp2
> > modules, requiring 'Apache2' (which doesn't exist within
> > mp1)?
>
> It won't work since the version number lives in the
> package mod_perl.  and most likely you'd want to require a
> minimal version at some point.

That's true - I forgot about that ... One could tie the
version of Apache.pm (for mp1) or Apache2.pm (for mp2) to
the corresponding mod_perl.pm version, and make a note of
that in the RELEASE notes, but I agree, that's not
addressing the underlying issue.

-- 
best regards,
randy


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Fri, 9 Jul 2004, David Wheeler wrote:
> 
> 
>>On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:
>>
>>
>>>There is no Apache.pm in mp2. You probably wanted to say:
>>>
>>>
>>>>    requires       => { 'mod_perl'   => 0,
>>
>>Right. In fact, it should probably be
>>
>>     requires       => { 'mod_perl'   => '1.0',
>>
>>in the MP1 example, and
>>
>>     requires       => { 'mod_perl'   => '1.99',
>>
>>in the MP2 example, yes?
> 
> 
> Assuming this is for the benefit of CPAN/CPANPLUS to install
> dependencies, doesn't this run into a couple of problems
> that, in particular, Stas has raised:
>  - CPAN doesn't yet support multiple module versions, only
> the latest (which currently is mp1, as mp2 is marked as
> a development version);
>  - if someone had mp2 installed in an Apache2/ subdirectory,
> CPAN/CPANPLUS wouldn't see it unless somehow 'use Apache2'
> was invoked to adjust @INC;
> 
> What about requiring 'Apache' for mp1-related modules (since
> 'Apache' doesn't exist within mp2), and for mp2 modules,
> requiring 'Apache2' (which doesn't exist within mp1)?

It won't work since the version number lives in the package mod_perl. 
and most likely you'd want to require a minimal version at some point.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Fri, 9 Jul 2004, David Wheeler wrote:
> 
> 
>>On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:
>>
>>
>>>There is no Apache.pm in mp2. You probably wanted to say:
>>>
>>>
>>>>    requires       => { 'mod_perl'   => 0,
>>
>>Right. In fact, it should probably be
>>
>>     requires       => { 'mod_perl'   => '1.0',
>>
>>in the MP1 example, and
>>
>>     requires       => { 'mod_perl'   => '1.99',
>>
>>in the MP2 example, yes?
> 
> 
> Assuming this is for the benefit of CPAN/CPANPLUS to install
> dependencies, doesn't this run into a couple of problems
> that, in particular, Stas has raised:
>  - CPAN doesn't yet support multiple module versions, only
> the latest (which currently is mp1, as mp2 is marked as
> a development version);
>  - if someone had mp2 installed in an Apache2/ subdirectory,
> CPAN/CPANPLUS wouldn't see it unless somehow 'use Apache2'
> was invoked to adjust @INC;
> 
> What about requiring 'Apache' for mp1-related modules (since
> 'Apache' doesn't exist within mp2), and for mp2 modules,
> requiring 'Apache2' (which doesn't exist within mp1)?

It won't work since the version number lives in the package mod_perl. 
and most likely you'd want to require a minimal version at some point.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, David Wheeler wrote:

> On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:
>
> > There is no Apache.pm in mp2. You probably wanted to say:
> >
> > >     requires       => { 'mod_perl'   => 0,
>
> Right. In fact, it should probably be
>
>      requires       => { 'mod_perl'   => '1.0',
>
> in the MP1 example, and
>
>      requires       => { 'mod_perl'   => '1.99',
>
> in the MP2 example, yes?

Assuming this is for the benefit of CPAN/CPANPLUS to install
dependencies, doesn't this run into a couple of problems
that, in particular, Stas has raised:
 - CPAN doesn't yet support multiple module versions, only
the latest (which currently is mp1, as mp2 is marked as
a development version);
 - if someone had mp2 installed in an Apache2/ subdirectory,
CPAN/CPANPLUS wouldn't see it unless somehow 'use Apache2'
was invoked to adjust @INC;

What about requiring 'Apache' for mp1-related modules (since
'Apache' doesn't exist within mp2), and for mp2 modules,
requiring 'Apache2' (which doesn't exist within mp1)?

-- 
best regards,
randy

Re: Apache-Test module skeletons

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Fri, 9 Jul 2004, David Wheeler wrote:

> On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:
>
> > There is no Apache.pm in mp2. You probably wanted to say:
> >
> > >     requires       => { 'mod_perl'   => 0,
>
> Right. In fact, it should probably be
>
>      requires       => { 'mod_perl'   => '1.0',
>
> in the MP1 example, and
>
>      requires       => { 'mod_perl'   => '1.99',
>
> in the MP2 example, yes?

Assuming this is for the benefit of CPAN/CPANPLUS to install
dependencies, doesn't this run into a couple of problems
that, in particular, Stas has raised:
 - CPAN doesn't yet support multiple module versions, only
the latest (which currently is mp1, as mp2 is marked as
a development version);
 - if someone had mp2 installed in an Apache2/ subdirectory,
CPAN/CPANPLUS wouldn't see it unless somehow 'use Apache2'
was invoked to adjust @INC;

What about requiring 'Apache' for mp1-related modules (since
'Apache' doesn't exist within mp2), and for mp2 modules,
requiring 'Apache2' (which doesn't exist within mp1)?

-- 
best regards,
randy

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:
> 
>> There is no Apache.pm in mp2. You probably wanted to say:
>>
>> >     requires       => { 'mod_perl'   => 0,
> 
> 
> Right. In fact, it should probably be
> 
>     requires       => { 'mod_perl'   => '1.0',
> 
> in the MP1 example, and
> 
>     requires       => { 'mod_perl'   => '1.99',
> 
> in the MP2 example, yes?

That's right. But better do it:

 >     requires       => { 'mod_perl'   => '1.9914',

to show how to require 1.99_14,



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:

> There is no Apache.pm in mp2. You probably wanted to say:
>
> >     requires       => { 'mod_perl'   => 0,

Right. In fact, it should probably be

     requires       => { 'mod_perl'   => '1.0',

in the MP1 example, and

     requires       => { 'mod_perl'   => '1.99',

in the MP2 example, yes?

Geoff, did you get all that? ;-)

Regards,

David


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 1:09 PM, Stas Bekman wrote:

> There is no Apache.pm in mp2. You probably wanted to say:
>
> >     requires       => { 'mod_perl'   => 0,

Right. In fact, it should probably be

     requires       => { 'mod_perl'   => '1.0',

in the MP1 example, and

     requires       => { 'mod_perl'   => '1.99',

in the MP2 example, yes?

Geoff, did you get all that? ;-)

Regards,

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
[...]
> And in fact, to make it more generally useful, I think I'd actually make 
> it:
> 
> use 5.00503;
> use Apache::TestMB;
> 
> Apache::TestMB->new(
>     module_name    => 'Apache::Test::Skeleton',
>     license        => 'perl',
>     requires       => { 'Apache'   => 0,
>                       },

There is no Apache.pm in mp2. You probably wanted to say:

 >     requires       => { 'mod_perl'   => 0,


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
[...]
> And in fact, to make it more generally useful, I think I'd actually make 
> it:
> 
> use 5.00503;
> use Apache::TestMB;
> 
> Apache::TestMB->new(
>     module_name    => 'Apache::Test::Skeleton',
>     license        => 'perl',
>     requires       => { 'Apache'   => 0,
>                       },

There is no Apache.pm in mp2. You probably wanted to say:

 >     requires       => { 'mod_perl'   => 0,


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 11:41 AM, Stas Bekman wrote:

> Isn't that Apache::TestMB?

D'oh! Yes! Sorry!

use 5.00503;
use Apache::TestMB;

Apache::TestMB->new(
     module_name => 'Apache::Test::Skeleton',
)->create_build_script;

And in fact, to make it more generally useful, I think I'd actually 
make it:

use 5.00503;
use Apache::TestMB;

Apache::TestMB->new(
     module_name    => 'Apache::Test::Skeleton',
     license        => 'perl',
     requires       => { 'Apache'   => 0,
                       },
     build_requires => { Test::More => 0,
                       },
)->create_build_script;


Regards,

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 9, 2004, at 11:41 AM, Stas Bekman wrote:

> Isn't that Apache::TestMB?

D'oh! Yes! Sorry!

use 5.00503;
use Apache::TestMB;

Apache::TestMB->new(
     module_name => 'Apache::Test::Skeleton',
)->create_build_script;

And in fact, to make it more generally useful, I think I'd actually 
make it:

use 5.00503;
use Apache::TestMB;

Apache::TestMB->new(
     module_name    => 'Apache::Test::Skeleton',
     license        => 'perl',
     requires       => { 'Apache'   => 0,
                       },
     build_requires => { Test::More => 0,
                       },
)->create_build_script;


Regards,

David


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 7, 2004, at 7:01 AM, Geoffrey Young wrote:
> 
>> the bug reporting skeleton has become so useful for me (and others) 
>> that I
>> have created two new skeletons:
> 
> 
> I would add a Build.PL with these contents:
> 
> use 5.00503;
> 
> use Apache::Test::MB;

Isn't that Apache::TestMB?

> Apache::Test::MB->new(
>     module_name => 'Apache::Test::Skeleton',
> )->create_build_script;
> 
> Regards,
> 
> David


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> On Jul 7, 2004, at 7:01 AM, Geoffrey Young wrote:
> 
>> the bug reporting skeleton has become so useful for me (and others) 
>> that I
>> have created two new skeletons:
> 
> 
> I would add a Build.PL with these contents:
> 
> use 5.00503;
> 
> use Apache::Test::MB;

Isn't that Apache::TestMB?

> Apache::Test::MB->new(
>     module_name => 'Apache::Test::Skeleton',
> )->create_build_script;
> 
> Regards,
> 
> David


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 7, 2004, at 7:01 AM, Geoffrey Young wrote:

> the bug reporting skeleton has become so useful for me (and others) 
> that I
> have created two new skeletons:

I would add a Build.PL with these contents:

use 5.00503;

use Apache::Test::MB;

Apache::Test::MB->new(
     module_name => 'Apache::Test::Skeleton',
)->create_build_script;

Regards,

David


Re: Apache-Test module skeletons

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Nice work, Geoff. May be they should live on CPAN, so one doesn't need
> to remember where to grab them from? e.g. create an empty
> Apache::Test::Skeleton::mod_perl(1|2) packages with versioning in those
> tars and upload to CPAN?

that's an idea, but kind of a long name :)  maybe just
Apache::Test::Skeleton::MP1 or something.

but yeah, I'll come up with a package and upload them to cpan soonish.

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> Nice work, Geoff. May be they should live on CPAN, so one doesn't need
> to remember where to grab them from? e.g. create an empty
> Apache::Test::Skeleton::mod_perl(1|2) packages with versioning in those
> tars and upload to CPAN?

that's an idea, but kind of a long name :)  maybe just
Apache::Test::Skeleton::MP1 or something.

but yeah, I'll come up with a package and upload them to cpan soonish.

--Geoff

Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> hi all...
> 
> the bug reporting skeleton has become so useful for me (and others) that I
> have created two new skeletons:
> 
>   http://perl.apache.org/~geoff/Apache-Test-skeleton-mp1.tar.gz
>   http://perl.apache.org/~geoff/Apache-Test-skeleton-mp2.tar.gz
> 
> these are essentially the same as the bug reporting skeletons but geared
> toward new module development - a basic handler exists in
> lib/Apache/Handler.pm, references to "bugs" have been removed, etc.

Nice work, Geoff. May be they should live on CPAN, so one doesn't need 
to remember where to grab them from? e.g. create an empty 
Apache::Test::Skeleton::mod_perl(1|2) packages with versioning in those 
tars and upload to CPAN?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by David Wheeler <da...@kineticode.com>.
On Jul 7, 2004, at 7:01 AM, Geoffrey Young wrote:

> the bug reporting skeleton has become so useful for me (and others) 
> that I
> have created two new skeletons:

I would add a Build.PL with these contents:

use 5.00503;

use Apache::Test::MB;

Apache::Test::MB->new(
     module_name => 'Apache::Test::Skeleton',
)->create_build_script;

Regards,

David


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache-Test module skeletons

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> hi all...
> 
> the bug reporting skeleton has become so useful for me (and others) that I
> have created two new skeletons:
> 
>   http://perl.apache.org/~geoff/Apache-Test-skeleton-mp1.tar.gz
>   http://perl.apache.org/~geoff/Apache-Test-skeleton-mp2.tar.gz
> 
> these are essentially the same as the bug reporting skeletons but geared
> toward new module development - a basic handler exists in
> lib/Apache/Handler.pm, references to "bugs" have been removed, etc.

Nice work, Geoff. May be they should live on CPAN, so one doesn't need 
to remember where to grab them from? e.g. create an empty 
Apache::Test::Skeleton::mod_perl(1|2) packages with versioning in those 
tars and upload to CPAN?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com