[Catalyst-commits] r10682 - in Catalyst-Runtime/5.80/trunk: lib
lib/Catalyst t/aggregate
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Fri Jun 26 19:45:46 GMT 2009
Author: rafl
Date: 2009-06-26 19:45:45 +0000 (Fri, 26 Jun 2009)
New Revision: 10682
Modified:
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm
Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_action.t
Log:
Fix annoying warnings in Utils::resolve_namespace.
Also get rid of some other nits introduced with resolve_namespace.
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2009-06-26 19:45:30 UTC (rev 10681)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2009-06-26 19:45:45 UTC (rev 10682)
@@ -680,7 +680,7 @@
sub dispatch_type {
my ($self, $name) = @_;
-
+
# first param is undef because we cannot get the appclass
$name = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $name);
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm 2009-06-26 19:45:30 UTC (rev 10681)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Utils.pm 2009-06-26 19:45:45 UTC (rev 10682)
@@ -385,7 +385,7 @@
Method which adds the namespace for plugins and actions.
__PACKAGE__->setup(qw(MyPlugin));
-
+
# will load Catalyst::Plugin::MyPlugin
=cut
@@ -395,9 +395,14 @@
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);
}
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-06-26 19:45:30 UTC (rev 10681)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-06-26 19:45:45 UTC (rev 10682)
@@ -2511,7 +2511,7 @@
$class->_plugins( {} ) unless $class->_plugins;
$plugins ||= [];
-
+
my @plugins = Catalyst::Utils::resolve_namespace($class . '::Plugin', 'Catalyst::Plugin', @$plugins);
for my $plugin ( reverse @plugins ) {
Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_action.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_action.t 2009-06-26 19:45:30 UTC (rev 10681)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_action.t 2009-06-26 19:45:45 UTC (rev 10682)
@@ -106,7 +106,7 @@
'Content is a serialized Catalyst::Request'
);
}
-
+
{
ok( my $response = request('http://localhost/action_action_five'),
'Request' );
@@ -126,7 +126,6 @@
'Content is a serialized Catalyst::Request'
);
}
-
{
ok( my $response = request('http://localhost/action_action_six'),
More information about the Catalyst-commits
mailing list