X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FApplication.pm;h=584b0e4e2f40790ee1d5fd81e22cbb49ba28def6;hb=34ac7eb6b8783f1ac946c3ac7dae5f184912a944;hp=df66285c75572249e9df5733496a8f8e61e190c1;hpb=767c12f0b134e503bdcd3c5e58464454f63192b0;p=maypole.git diff --git a/lib/Maypole/Application.pm b/lib/Maypole/Application.pm index df66285..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,14 +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: $@) } @@ -41,6 +30,7 @@ sub import { } } } + $caller->setup() if $autosetup; } if ( $ENV{MOD_PERL} ) {