renaming method get_components_names_types
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 6df1fd8..1c3043f 100644 (file)
@@ -1031,11 +1031,11 @@ EOF
 
     if (
         $class->debug and
-        my @comps_types = $class->container->get_components_types
+        my @comps_names_types = $class->container->get_components_names_types
     ) {
         my $column_width = Catalyst::Utils::term_width() - 8 - 9;
         my $t = Text::SimpleTable->new( [ $column_width, 'Class' ], [ 8, 'Type' ] );
-        $t->row( @$_ ) for @comps_types;
+        $t->row( @$_ ) for @comps_names_types;
 
         $class->log->debug( "Loaded components:\n" . $t->draw . "\n" );
     }
@@ -1446,9 +1446,7 @@ sub components {
     my $container = $class->container;
 
     if ( $comps ) {
-        $container->add_component(
-            $_, $class
-        ) for keys %$comps;
+        $container->add_component( $_ ) for keys %$comps;
     }
 
     return $container->get_all_components();
@@ -2317,16 +2315,30 @@ The C<setup_components> config option is passed to both of the above methods.
 =cut
 
 sub setup_components {
-    my $class = shift;
-    # FIXME - I believe I shouldn't be handing $class over
-    # Just don't know how to solve this.
-    return $class->container->setup_components( $class );
+    shift->container->setup_components();
 }
 
+=head2 locate_components
+
+=cut
+
 # FIXME - removed locate_components
 # don't people mess with this method directly?
 # what to do with that?
 
+sub locate_components {
+    my $class = shift;
+
+    $class->log->warn('The locate_components method has been deprecated.');
+    $class->log->warn('Please read Catalyst::IOC::Container documentation to');
+    $class->log->warn('update your application.');
+
+    # XXX think about ditching this sort entirely
+    return sort { length $a <=> length $b }
+        @{ $class->container->resolve( service => 'locate_components' ) };
+}
+
+
 =head2 $c->setup_dispatcher
 
 Sets up dispatcher.