X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FApplication.pm;h=584b0e4e2f40790ee1d5fd81e22cbb49ba28def6;hb=22d37ee308fb33851a41cfa724d34ab9528cc57f;hp=a3cd971163187bcd54a995533677a1947a7f802f;hpb=2d3e46a739e4bd7155cf0bf40073074734768606;p=maypole.git diff --git a/lib/Maypole/Application.pm b/lib/Maypole/Application.pm index a3cd971..584b0e4 100644 --- a/lib/Maypole/Application.pm +++ b/lib/Maypole/Application.pm @@ -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} ) {