[Jifty-commit] r2710 - in jifty/branches/virtual-models: . lib/Jifty/Module

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Jan 29 04:30:23 EST 2007


Author: audreyt
Date: Mon Jan 29 04:30:23 2007
New Revision: 2710

Modified:
   jifty/branches/virtual-models/   (props changed)
   jifty/branches/virtual-models/lib/Jifty/Module/Pluggable.pm
   jifty/branches/virtual-models/lib/Jifty/Plugin/REST/Dispatcher.pm

Log:
 r26969 at 122-126-37-36 (orig r2697):  audreyt | 2007-01-29 00:08:00 +0800
 * strict, warnings, and redefinition warning avoidance for J::Module::Pluggable.
 r26972 at 122-126-37-36 (orig r2700):  trs | 2007-01-29 11:17:23 +0800
  r19265 at zot:  tom | 2007-01-28 22:17:12 -0500
  Squash warning
 


Modified: jifty/branches/virtual-models/lib/Jifty/Module/Pluggable.pm
==============================================================================
--- jifty/branches/virtual-models/lib/Jifty/Module/Pluggable.pm	(original)
+++ jifty/branches/virtual-models/lib/Jifty/Module/Pluggable.pm	Mon Jan 29 04:30:23 2007
@@ -1,4 +1,6 @@
 package Jifty::Module::Pluggable;
+use strict;
+use warnings;
 use base qw/Module::Pluggable/;
 
 =head1 NAME
@@ -40,6 +42,8 @@
 
 use Module::Pluggable::Object;
 use UNIVERSAL::require;
+
+no warnings 'redefine';
 sub Module::Pluggable::Object::_require {
     my $self = shift;
     my $module = shift;
@@ -47,11 +51,9 @@
     # Module::Pluggable::Object::_require expects a true value (the error message) on failure
     # On success, it expects you to return undef.
 
-    local $UNIVERSAL::require::ERROR = undef;
+    local $UNIVERSAL::require::ERROR;
     $module->require(); # We'd prefer to use Jifty::Util->require() here, but it spews crazy warnings
-     return $UNIVERSAL::require::ERROR;
-
-
+    return $UNIVERSAL::require::ERROR;
 } 
 
 1;

Modified: jifty/branches/virtual-models/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/branches/virtual-models/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/branches/virtual-models/lib/Jifty/Plugin/REST/Dispatcher.pm	Mon Jan 29 04:30:23 2007
@@ -121,7 +121,7 @@
         }
     }
 
-    warn "Unable to handle object of type ", ref $obj, ", attempting to stringify.\n";
+    # Attempt to stringify as last resort
     return stringify( $obj );
 }
 


More information about the Jifty-commit mailing list