make sure injected comps have the correct namespace
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 358e7c7..1120eda 100644 (file)
@@ -157,7 +157,7 @@ sub composed_stats_class {
 __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC);
 
 # Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.90090';
+our $VERSION = '5.90091';
 $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
 
 sub import {
@@ -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 )