Mailing List Archive

couple of small patches
I get some test failures with current svn trunk of catalyst
(revision 535). The patch attached fixes them.

* Minor POD tweak.

* 't/01use.t' fails because Catalyst.pm comes up with an undefined
value for '$path' and then tries to pass it to Path::Class. That
causes uninitialized value warnings, so I wrapped definedness
tests round a few pieces of code, which at least makes the tests
happy. But does it make any sense to carry on if $home isn't
defined?

* When 'use'ing Path::Class I think it would be better to name the
functions being imported. Not only is it more greppable, but it will
work with earlier versions (I tried it first with 0.03 which doesn't
export those functions by default).

HTH.
qef

--

--- Geoff Richards -------------><-------------- http://ungwe.org/ ---
"I tried to fling my shadow at the moon,
The while my blood leapt with a wordless song." -- Theodore Roethke
-------------- next part --------------
Index: lib/Catalyst.pm
===================================================================
--- lib/Catalyst.pm (revision 535)
+++ lib/Catalyst.pm (working copy)
@@ -5,7 +5,7 @@
use UNIVERSAL::require;
use Catalyst::Log;
use Text::ASCIITable;
-use Path::Class;
+use Path::Class qw(file dir);
our $CATALYST_SCRIPT_GEN = 4;

__PACKAGE__->mk_classdata($_) for qw/dispatcher engine log/;
@@ -249,13 +249,16 @@
my $name = $caller;
$name =~ s/\:\:/\//g;
my $path = $INC{"$name.pm"};
- my $home = file($path)->absolute->dir;
- $name =~ /(\w+)$/;
- my $append = $1;
- my $subdir = dir($home)->subdir($append);
- for ( split '/', $name ) { $home = dir($home)->parent }
- if ( $home =~ /blib$/ ) { $home = dir($home)->parent }
- elsif ( !-f file( $home, 'Makefile.PL' ) ) { $home = $subdir }
+ my $home;
+ if (defined $path) {
+ $home = file($path)->absolute->dir;
+ $name =~ /(\w+)$/;
+ my $append = $1;
+ my $subdir = dir($home)->subdir($append);
+ for ( split '/', $name ) { $home = dir($home)->parent }
+ if ( $home =~ /blib$/ ) { $home = dir($home)->parent }
+ elsif ( !-f file( $home, 'Makefile.PL' ) ) { $home = $subdir }
+ }

if ( $caller->debug ) {
$home
@@ -265,7 +268,7 @@
: $caller->log->debug(q/Couldn't find home/);
}
$caller->config->{home} = $home;
- $caller->config->{root} = dir($home)->subdir('root');
+ $caller->config->{root} = dir($home)->subdir('root') if defined $home;
}

=item $c->engine
Index: lib/Catalyst/Build.pm
===================================================================
--- lib/Catalyst/Build.pm (revision 535)
+++ lib/Catalyst/Build.pm (working copy)
@@ -27,6 +27,8 @@

=head1 METHODS

+=over 4
+
=item ACTION_install

=cut
couple of small patches [ In reply to ]
Am 27.04.2005 um 22:18 schrieb Geoff Richards:

> I get some test failures with current svn trunk of catalyst
> (revision 535). The patch attached fixes them.
>
> * Minor POD tweak.
>
> * 't/01use.t' fails because Catalyst.pm comes up with an undefined
> value for '$path' and then tries to pass it to Path::Class. That
> causes uninitialized value warnings, so I wrapped definedness
> tests round a few pieces of code, which at least makes the tests
> happy. But does it make any sense to carry on if $home isn't
> defined?
>
> * When 'use'ing Path::Class I think it would be better to name the
> functions being imported. Not only is it more greppable, but it
> will
> work with earlier versions (I tried it first with 0.03 which doesn't
> export those functions by default).

Thx, applied.

--
sebastian
couple of small patches [ In reply to ]
On Wed, Apr 27, 2005 at 11:21:10PM +0200, Sebastian Riedel wrote:
> Am 27.04.2005 um 22:18 schrieb Geoff Richards:
> >I get some test failures with current svn trunk of catalyst
> >(revision 535). The patch attached fixes them.
> >
> > * Minor POD tweak.
> >...
>
> Thx, applied.

Oops, you've now got "=over4" when Pod::Checker thinks it should
be "=over 4".

--

--- Geoff Richards -------------><-------------- http://ungwe.org/ ---
"I tried to fling my shadow at the moon,
The while my blood leapt with a wordless song." -- Theodore Roethke
couple of small patches [ In reply to ]
Am 28.04.2005 um 17:25 schrieb Geoff Richards:

> On Wed, Apr 27, 2005 at 11:21:10PM +0200, Sebastian Riedel wrote:
>> Am 27.04.2005 um 22:18 schrieb Geoff Richards:
>>> I get some test failures with current svn trunk of catalyst
>>> (revision 535). The patch attached fixes them.
>>>
>>> * Minor POD tweak.
>>> ...
>>
>> Thx, applied.
>
> Oops, you've now got "=over4" when Pod::Checker thinks it should
> be "=over 4".

Fixed.

--
sebastian