]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Application.pm
Ordering should not matter for parameters to ::Application.
[maypole.git] / lib / Maypole / Application.pm
index a3cd971163187bcd54a995533677a1947a7f802f..584b0e4e2f40790ee1d5fd81e22cbb49ba28def6 100644 (file)
@@ -5,18 +5,6 @@ use warnings;
 use UNIVERSAL::require;
 use Maypole;
 
-# funny little gimmick ;)
-my $banner = <<'';
- __  __                         _
-|  \/  | __ _ _   _ _ __   ___ | | ___
-| |\/| |/ _` | | | | '_ \ / _ \| |/ _ \
-| |  | | (_| | |_| | |_) | (_) | |  __/
-|_|  |_|\__,_|\__, | .__/ \___/|_|\___|
-              |___/|_| -= VERSION =-
-
-$banner =~ s/VERSION/$Maypole::VERSION/;
-warn $banner;
-
 our @ISA;
 
 sub import {
@@ -24,15 +12,15 @@ sub import {
     my $caller = caller(0);
     no strict 'refs';
     push @{"${caller}::ISA"}, $self;
-    foreach (@plugins) {
-        if    (/^\-Setup$/) { $caller->setup }
+    my $autosetup=0;
+    foreach (sort @plugins) {
+        if    (/^\-Setup$/) { $autosetup++; }
         elsif (/^\-Debug$/) {
             *{"$caller\::debug"} = sub { 1 };
             warn "Debugging enabled";
         }
         elsif (/^-.*$/) { warn "Unknown flag: $_" }
         else {
-
             # The plugin caller should be our application class
             eval "package $caller; require Maypole::Plugin::$_";
             if ($@) { warn qq(Loading plugin "Maypole::Plugin::$_" failed: $@) }
@@ -42,6 +30,7 @@ sub import {
             }
         }
     }
+    $caller->setup() if $autosetup;
 }
 
 if ( $ENV{MOD_PERL} ) {