[Rt-commit] rt branch, runtime-plugin, updated. rt-3.9.4-419-gf448e4f

Chia-liang Kao clkao at bestpractical.com
Mon Nov 8 08:53:24 EST 2010


The branch, runtime-plugin has been updated
       via  f448e4f57f5f61dd1832c7ae7b37a3161dec2420 (commit)
      from  511b2a6cabf7608f008b09363d41c001d7135102 (commit)

Summary of changes:
 lib/RT.pm       |   11 ++++++-----
 lib/RT/Test.pm  |    3 ++-
 t/plugins/api.t |    9 +++++++--
 3 files changed, 15 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit f448e4f57f5f61dd1832c7ae7b37a3161dec2420
Author: Chia-liang Kao <clkao at bestpractical.com>
Date:   Mon Nov 8 12:40:40 2010 +0800

    Avoid using InitPluginPaths, which is deprecated

diff --git a/lib/RT.pm b/lib/RT.pm
index ee2f6e2..978c79d 100755
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -604,14 +604,11 @@ In case F<local/lib> isn't in @INC, append them to @INC
 =cut
 
 sub InitPluginPaths {
-    warn "DEPRECATED";
+    Carp::carp "DEPRECATED";
     my $self = shift || __PACKAGE__;
 
     $self->ProbePlugins(1);
-    if ($LOADED_PLUGINS) {
-        Carp::carp "reinitializing plugin paths";
-        $LOADED_PLUGINS = undef;
-    }
+    $self->UnloadPlugins();
 }
 
 =head2 InitPlugins
@@ -641,6 +638,10 @@ sub InitPlugins {
     return @$LOADED_PLUGINS;
 }
 
+sub UnloadPlugins {
+    my $self = shift;
+    $LOADED_PLUGINS = undef;
+}
 
 sub InstallMode {
     my $self = shift;
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index c62893a..1a16a65 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -430,7 +430,8 @@ sub bootstrap_plugins {
     };
 
     RT->Config->Set( Plugins => @plugins );
-    RT->InitPluginPaths();
+    RT->ProbePlugins(1);
+    RT->UnloadPlugins();
 
     my $dba_dbh;
     $dba_dbh = _get_dbh(
diff --git a/t/plugins/api.t b/t/plugins/api.t
index f666ee5..7fedd97 100644
--- a/t/plugins/api.t
+++ b/t/plugins/api.t
@@ -10,8 +10,11 @@ use RT::Test nodb => 1, tests => 7;
 is_deeply([RT->PluginDirs('lib')], []);
 ok(!grep { $_ eq "$RT::PluginPath/Hello/lib" } @INC);;
 RT->Config->Set('Plugins',qw(Hello));
-RT->InitPluginPaths;
+
+RT->ProbePlugins(1);
+RT->UnloadPlugins;
 RT->Plugins;
+
 ok(grep { $_ eq "$RT::PluginPath/Hello/lib" } @INC);;
 
 is_deeply([RT->PluginDirs('lib')], ["$RT::PluginPath/Hello/lib"], 'plugin lib dir found');
@@ -23,6 +26,8 @@ is_deeply({RT::Interface::Web::Handler->DefaultHandlerArgs}->{comp_root}[1],
 
 # reset
 RT->Config->Set('Plugins',qw());
-RT->InitPluginPaths;
+RT->ProbePlugins(1);
+RT->UnloadPlugins;
+
 ok(!grep { $_ eq "$RT::PluginPath/Hello/lib" } @INC);
 is({RT::Interface::Web::Handler->DefaultHandlerArgs}->{comp_root}[1][0],'standard');

-----------------------------------------------------------------------


More information about the Rt-commit mailing list