[prev] [thread] [next] [lurker] [Date index for 2002/09/10]
Update of /cvsroot/siesta/siesta/lib In directory usw-pr-cvs1:/tmp/cvs-serv19714 Modified Files: Siesta.pm Log Message: perltidy Index: Siesta.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Siesta.pm 8 Sep 2002 15:06:28 -0000 1.17 +++ Siesta.pm 10 Sep 2002 18:23:16 -0000 1.18 @@ -2,7 +2,7 @@ package Siesta; use strict; use vars qw/$VERSION/; -$VERSION = 1.0; # baby! +$VERSION = 1.0; # baby! use constant debug => 0; use Siesta::Message; @@ -24,25 +24,25 @@ =cut sub process { - my $class = shift; - my %args = @_; + my $class = shift; + my %args = @_; my $action = $args{action} || 'post'; - my $mail = Siesta::Message->new( $args{mail} ); - my $list = $mail->list( Siesta::List->new( $args{list} ) ) + my $mail = Siesta::Message->new( $args{mail} ); + my $list = $mail->list( Siesta::List->new( $args{list} ) ) or die "couldn't load list '$args{list}'"; - my @plugins; # plugins to run - if ($action eq 'post') { @plugins = $list->plugins } - elsif ($action eq 'sub') { @plugins = qw( Subscribe ) } - elsif ($action eq 'unsub') { @plugins = qw( UnSubscribe ) } - else { @plugins = qw( Domo ) }; + my @plugins; # plugins to run + if ( $action eq 'post' ) { @plugins = $list->plugins } + elsif ( $action eq 'sub' ) { @plugins = qw( Subscribe ) } + elsif ( $action eq 'unsub' ) { @plugins = qw( UnSubscribe ) } + else { @plugins = qw( Domo ) } - for my $class (map { "Siesta::Plugin::$_" } @plugins ) { + for my $class ( map { "Siesta::Plugin::$_" } @plugins ) { print "$class\n" if debug; eval "require $class"; die $@ if $@; my $plugin = $class->new; - return if $plugin->process( $mail ); + return if $plugin->process($mail); } } @@ -53,8 +53,9 @@ =cut my $storage; + sub connect { - my $self = shift; + my $self = shift; my $class = shift; return unless $class; @@ -79,11 +80,11 @@ sub list_all_plugins { my @dirs; - foreach my $dir (map { "$_/Siesta/Plugin" } @INC) { - push @dirs, $dir if (-e $dir && -d $dir); + foreach my $dir ( map { "$_/Siesta/Plugin" } @INC ) { + push @dirs, $dir if ( -e $dir && -d $dir ); } - my @files = find (name => "*.pm", in => \@dirs); + my @files = find( name => "*.pm", in => \@dirs ); my @plugins; foreach my $file (@files) { @@ -93,9 +94,8 @@ my %plugins = map { $_ => 1 } @plugins; - return sort keys %plugins + return sort keys %plugins; } - 1;
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52