From: John Napiorkowski Date: Mon, 18 May 2015 23:01:38 +0000 (-0400) Subject: make sure injected comps have the correct namespace X-Git-Tag: 5.90092~1^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=30e860a01566a3a22e976747805366171aae132b;hp=c527a435b600f70a18d6877d992d951486160ccd make sure injected comps have the correct namespace --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 016ef2d..1120eda 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2854,10 +2854,10 @@ sub setup_components { # of named components in the configuration that are not actually existing (not a # real file). - $class->setup_injected_components; + my @injected = $class->setup_injected_components; # All components are registered, now we need to 'init' them. - foreach my $component_name (keys %{$class->components||+{}}) { + foreach my $component_name (@injected, @comps) { $class->components->{$component_name} = $class->components->{$component_name}->() if (ref($class->components->{$component_name}) || '') eq 'CODE'; } @@ -2878,6 +2878,9 @@ sub setup_injected_components { $injected_comp_name, $class->config->{inject_components}->{$injected_comp_name}); } + + return map { $class ."::" . $_ } + @injected_components; } =head2 $app->setup_injected_component( $injected_component_name, $config )