X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=05248fc5824af0e647ee7637260ed917cd715afa;hb=fb0c5b21c3c972bc88b8c6c481f9937f31658a23;hp=5bff574550f707f0df1faf950087f09d9c1b026e;hpb=d58edd2a603bb985a2f3beed0175594759b54bb3;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 5bff574..05248fc 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -385,7 +385,7 @@ sub term_width { Method which adds the namespace for plugins and actions. __PACKAGE__->setup(qw(MyPlugin)); - + # will load Catalyst::Plugin::MyPlugin =cut @@ -395,9 +395,14 @@ sub resolve_namespace { my $appnamespace = shift; my $namespace = shift; my @classes = @_; - return String::RewritePrefix->rewrite( - { '' => $namespace.'::', '+' => '', '~' => $appnamespace . '::' }, @classes, - ); + return String::RewritePrefix->rewrite({ + q[] => qq[${namespace}::], + q[+] => q[], + (defined $appnamespace + ? (q[~] => qq[${appnamespace}::]) + : () + ), + }, @classes); }