[Jifty-commit] r6567 - in jifty/trunk: lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Mon Mar 9 12:00:39 EDT 2009


Author: jesse
Date: Mon Mar  9 12:00:38 2009
New Revision: 6567

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Plugin.pm

Log:
 r60037 at 17h:  jesse | 2009-03-09 15:30:22 +0000
 Sometimes we're generating paths with a trailing slash. that sucks. this is a bandaid
 r60101 at 17h:  jesse | 2009-03-09 16:00:11 +0000
 * Handle external plugins with sharedirs, RT::Plugin::Foo needs this


Modified: jifty/trunk/lib/Jifty/Plugin.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin.pm	Mon Mar  9 12:00:38 2009
@@ -108,7 +108,7 @@
 }
 
 sub _calculate_share {
-    my $self = shift;
+    my $self  = shift;
     my $class = ref($self);
 
     unless ( $self->{share} ) {
@@ -127,6 +127,17 @@
         $self->{share} = Jifty::Util->share_root;
         $self->{share} .= "/plugins/" . $class_to_path;
     }
+    unless ( -d $self->{share} ) {
+
+        # for the plugin share resides in plugins/NAME/share
+        my $class_to_path = $class;
+        $class_to_path =~ s|::|/|g;
+
+        $self->{share} = $INC{ $class_to_path . '.pm' };
+        $self->{share} =~ s{lib/+\Q$class_to_path.pm}{share};
+        $self->{share} = File::Spec->rel2abs( $self->{share} );
+
+    }
     return $self->{share};
 }
 


More information about the Jifty-commit mailing list