[Jifty-commit] r4170 - in jifty/trunk: lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Oct 2 00:55:19 EDT 2007
Author: jesse
Date: Tue Oct 2 00:55:17 2007
New Revision: 4170
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/ClassLoader.pm
jifty/trunk/lib/Jifty/Util.pm
Log:
r27295 at hualien: jesse | 2007-10-02 00:50:39 -0400
* Rather than helpfully failing to load model classes that have compiletime errors, actually die with the error that caused the class not to load.
Modified: jifty/trunk/lib/Jifty/ClassLoader.pm
==============================================================================
--- jifty/trunk/lib/Jifty/ClassLoader.pm (original)
+++ jifty/trunk/lib/Jifty/ClassLoader.pm Tue Oct 2 00:55:17 2007
@@ -323,13 +323,16 @@
Jifty::Module::Pluggable->import(
# $base goes last so we pull in the view class AFTER the model classes
search_path => [map { $base . "::" . $_ } ('Model', 'Action', 'Notification', 'Event')],
- require => 1,
+ require => 0,
except => qr/\.#/,
inner => 0
);
# Construct the list of models for the application for later reference
my %models;
+ for ($self->plugins) {
+ Jifty::Util->require($_);
+ }
$models{$_} = 1 for grep {/^($base)::Model::(.*)$/ and not /Collection(?:$||\:\:)/} $self->plugins;
$self->models(sort keys %models);
Modified: jifty/trunk/lib/Jifty/Util.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Util.pm (original)
+++ jifty/trunk/lib/Jifty/Util.pm Tue Oct 2 00:55:17 2007
@@ -243,10 +243,10 @@
my $error = $@;
if (my $message = $error) {
$message =~ s/ at .*?\n$//;
- if ($args{'quiet'} and $message =~ /^Can't locate/) {
+ if ($args{'quiet'} and $message =~ /^Can't locate $pkg/) {
return 0;
}
- elsif ( $error !~ /^Can't locate/) {
+ elsif ( $error !~ /^Can't locate $pkg/) {
die $error;
} else {
Jifty->log->error(sprintf("$message at %s line %d\n", (caller(1))[1,2]));
More information about the Jifty-commit
mailing list