From: Tyler Riddle Date: Tue, 9 Oct 2012 21:41:10 +0000 (-0700) Subject: fix that pesky problem with basic_data.t being broken X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=62796659d104e23fe96246e1139df0d024c84495;p=scpubgit%2FObject-Remote.git fix that pesky problem with basic_data.t being broken --- diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index b18b974..a2a004d 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -193,7 +193,7 @@ sub _build__json { sub _load_if_possible { my ($class) = @_; - eval "require $class"; + use_module($class); if ($@) { log_debug { "Attempt at loading '$class' failed with '$@'" }; diff --git a/lib/Object/Remote/Logging.pm b/lib/Object/Remote/Logging.pm index f30a318..b9276e9 100644 --- a/lib/Object/Remote/Logging.pm +++ b/lib/Object/Remote/Logging.pm @@ -2,9 +2,8 @@ package Object::Remote::Logging; use strictures 1; -use Log::Contextual qw( :log ); use Object::Remote::LogRouter; -use Object::Remote::LogDestination; +use Object::Remote::LogDestination; use Log::Contextual::SimpleLogger; use Carp qw(cluck); diff --git a/lib/Object/Remote/ModuleLoader.pm b/lib/Object/Remote/ModuleLoader.pm index 8b2e6c2..6ef459b 100644 --- a/lib/Object/Remote/ModuleLoader.pm +++ b/lib/Object/Remote/ModuleLoader.pm @@ -3,7 +3,7 @@ package Object::Remote::ModuleLoader; BEGIN { package Object::Remote::ModuleLoader::Hook; use Moo; - use Object::Remote::Logging qw(:log); + use Object::Remote::Logging qw( :log :dlog ); has sender => (is => 'ro', required => 1); # unqualified INC forced into package main @@ -12,8 +12,10 @@ BEGIN { log_debug { "Loading $module via " . ref($self) }; if (my $code = $self->sender->source_for($module)) { open my $fh, '<', \$code; + Dlog_trace { "Module sender successfully sent code for '$module': $code" } $code; return $fh; } + log_trace { "Module sender did not return code for '$module'" }; return; } } diff --git a/lib/Object/Remote/ModuleSender.pm b/lib/Object/Remote/ModuleSender.pm index ae1f72c..4b8be9b 100644 --- a/lib/Object/Remote/ModuleSender.pm +++ b/lib/Object/Remote/ModuleSender.pm @@ -20,7 +20,8 @@ sub source_for { log_debug { "locating source for module '$module'" }; if (my $find = Object::Remote::FromData->can('find_module')) { if (my $source = $find->($module)) { - return Dlog_trace { "Object::Remote::FromData->find_module('$module') returned '$_'" } $source; + Dlog_trace { "Object::Remote::FromData->find_module('$module') returned '$_'" } $source; + return $source; } } log_trace { "Searching for module in library directories" }; diff --git a/lib/Object/Remote/Role/Connector/PerlInterpreter.pm b/lib/Object/Remote/Role/Connector/PerlInterpreter.pm index 58eb93d..420707f 100644 --- a/lib/Object/Remote/Role/Connector/PerlInterpreter.pm +++ b/lib/Object/Remote/Role/Connector/PerlInterpreter.pm @@ -86,7 +86,7 @@ sub _start_perl { if (defined($given_stderr)) { #if the stderr data goes to an existing file handle - #an need an anonymous file handle is required + #an anonymous file handle is required #as the other half of a pipe style file handle pair #so the file handles can go into the run loop $foreign_stderr = gensym(); diff --git a/lib/Object/Remote/Role/LogForwarder.pm b/lib/Object/Remote/Role/LogForwarder.pm index d65ed17..6350489 100644 --- a/lib/Object/Remote/Role/LogForwarder.pm +++ b/lib/Object/Remote/Role/LogForwarder.pm @@ -5,7 +5,6 @@ package Object::Remote::Role::LogForwarder; use Moo::Role; -use Object::Remote::Logging; use Scalar::Util qw(weaken); use Carp qw(cluck);