[Rt-commit] r19743 - rt/3.8/trunk/lib

ruz at bestpractical.com ruz at bestpractical.com
Wed May 20 11:49:19 EDT 2009


Author: ruz
Date: Wed May 20 11:49:19 2009
New Revision: 19743

Modified:
   rt/3.8/trunk/lib/RT.pm.in

Log:
* use RT::Plugin in RT->PluginDirs, so we can override only one place in our tests

Modified: rt/3.8/trunk/lib/RT.pm.in
==============================================================================
--- rt/3.8/trunk/lib/RT.pm.in	(original)
+++ rt/3.8/trunk/lib/RT.pm.in	Wed May 20 11:49:19 2009
@@ -570,18 +570,20 @@
 
 Takes optional subdir (e.g. po, lib, etc.) and return plugins' dirs that exist.
 
+This code chacke plugins names or anything else and required when main config
+is loaded to load plugins' configs.
+
 =cut
 
 sub PluginDirs {
     my $self = shift;
     my $subdir = shift;
 
+    require RT::Plugin;
+
     my @res;
     foreach my $plugin (grep $_, RT->Config->Get('Plugins')) {
-        my $plugindir = $plugin;
-        $plugindir =~ s/::/-/g;
-        my $path = $RT::LocalPluginPath. "/$plugindir";
-        $path .= "/$subdir" if defined $subdir && length $subdir;
+        my $path = RT::Plugin->new( name => $plugin )->Path( $subdir );
         next unless -d $path;
         push @res, $path;
     }


More information about the Rt-commit mailing list