Actually, lets just use get_all_components
Tomas Doran [Tue, 2 Aug 2011 21:01:24 +0000 (22:01 +0100)]
TODO
lib/Catalyst.pm
lib/Catalyst/IOC/Container.pm

diff --git a/TODO b/TODO
index 6c74e14..19b74d8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -152,12 +152,6 @@ after BUILD => sub {
       - can we be more lazy?
       - should setup_components be a service that things like the ->component lookup
         can depend on?
-      
-    get_components_names_types
-
-    +# FIXME - t0m, how do you feel about this name?
-    +# also, do you think I should draw it here, or just return the data structure?
-    +sub get_components_names_types {
 
     +Same as L<build_model_subcontainer>, but for controllers. The difference is
     +that there is no ACCEPT_CONTEXT for controllers.
@@ -170,8 +164,6 @@ after BUILD => sub {
        Without this change, the user could make a custom service which mangled the param, and use 
        Catalyst/IOC/Service/WithAcceptContext.pm, with this change, that module will always see the
        un-mangled version?? However, without this change, shit doesn't work...
-
-    accept_context_args - where does this come from?
     
     +    $purity = $purity // 1;
     ^^ perl 5.10 only
index 7c51d8d..571c535 100644 (file)
@@ -1017,11 +1017,11 @@ EOF
 
     if (
         $class->debug and
-        my @comps_names_types = $class->container->get_components_names_types
+        my %comps = $class->container->get_all_components
     ) {
         my $column_width = Catalyst::Utils::term_width() - 8 - 9;
         my $t = Text::SimpleTable->new( [ $column_width, 'Class' ], [ 8, 'Type' ] );
-        $t->row( @$_ ) for @comps_names_types;
+        $t->row( $_ => ref($comps) ? 'instance' : 'class' ) for keys %comps;
 
         $class->log->debug( "Loaded components:\n" . $t->draw . "\n" );
     }
index cca2173..825f6f1 100644 (file)
@@ -603,25 +603,6 @@ sub find_component_regexp {
     return @result;
 }
 
-# FIXME - t0m, how do you feel about this name?
-# also, do you think I should draw it here, or just return the data structure?
-sub get_components_names_types {
-    my ( $self ) = @_;
-    my @comps_names_types;
-
-    for my $sub_container_name (qw/model view controller/) {
-        my $sub_container = $self->get_sub_container($sub_container_name);
-        for my $service ( $sub_container->get_service_list ) {
-            my $comp     = $sub_container->resolve(service => $service);
-            my $compname = ref $comp || $comp;
-            my $type     = ref $comp ? 'instance' : 'class';
-            push @comps_names_types, [ $compname, $type ];
-        }
-    }
-
-    return @comps_names_types;
-}
-
 sub get_all_components {
     my $self = shift;
     my %components;