[siesta-commit] siesta/lib Siesta.pm,1.14,1.15

[prev] [thread] [next] [lurker] [Date index for 2002/09/06]

From: muttley
Subject: [siesta-commit] siesta/lib Siesta.pm,1.14,1.15
Date: 11:29 on 06 Sep 2002
Update of /cvsroot/siesta/siesta/lib
In directory usw-pr-cvs1:/tmp/cvs-serv30795/lib

Modified Files:
	Siesta.pm 
Log Message:
Add a method for finding all the plugins installed.


Index: Siesta.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Siesta.pm	5 Sep 2002 16:13:16 -0000	1.14
+++ Siesta.pm	6 Sep 2002 10:29:09 -0000	1.15
@@ -7,6 +7,7 @@
 use constant debug => 0;
 use Siesta::Message;
 use Siesta::List;
+use File::Find::Rule qw/find/;
 
 =item ->process( mail => $message, action => $action, list => $list )
 
@@ -75,6 +76,26 @@
     $storage;
 }
 
+sub list_all_plugins
+{
+	my @dirs;
+
+	foreach my $dir (map { "$_/Siesta/Plugin" } @INC)
+	{
+		push @dirs, $dir if (-e $dir && -d $dir);
+	}
+
+	my @files = find (name => "*.pm", in => \@dirs);
+	my @plugins;
+
+	foreach my $file (@files)
+	{
+        	$file =~ s!^.*[\\/](.+=?)\.pm!$1!i;
+        	push @plugins, $file;
+	}
+
+	return @plugins;
+}
 
 
 1;



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52