From: Justin Hunter Date: Mon, 16 Aug 2010 18:11:03 +0000 (+0000) Subject: get the components from their services in the sub-containers, not from $c->components X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4b4dab9421a437c239a416fb3afb49c83196a16b get the components from their services in the sub-containers, not from $c->components --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index dfd7863..5a66003 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -548,9 +548,11 @@ sub _comp_names_search_prefixes { my $filter = "^${appclass}::(" . join( '|', @prefixes ) . ')::'; $filter = qr/$filter/; # Compile regex now rather than once per loop + my @components = map { $c->container->get_sub_container($_)->get_service_list } $c->container->get_sub_container_list; + # map the original component name to the sub part that we will search against my %eligible = map { my $n = $_; $n =~ s{^$appclass\::[^:]+::}{}; $_ => $n; } - grep { /$filter/ } keys %{ $c->components }; + grep { /$filter/ } @components; # undef for a name will return all return keys %eligible if !defined $name;