more fixes to regexp fallback, ugh.
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 818701e..bed30ee 100644 (file)
@@ -64,7 +64,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.7099_01';
+our $VERSION = '5.7099_02';
 
 sub import {
     my ( $class, @arguments ) = @_;
@@ -452,7 +452,12 @@ sub _comp_search_prefixes {
 
     # regexp fallback
     $query  = qr/$name/i;
-    @result = grep { $eligible{ $_ } =~ m{$query} } keys %eligible;
+    @result = map { $c->components->{ $_ } } grep { $eligible{ $_ } =~ m{$query} } keys %eligible;
+
+    # no results? try against full names
+    if( !@result ) {
+        @result = map { $c->components->{ $_ } } grep { m{$query} } keys %eligible;
+    }
 
     # don't warn if we didn't find any results, it just might not exist
     if( @result ) {
@@ -525,7 +530,7 @@ Gets a L<Catalyst::Model> instance by name.
 Any extra arguments are directly passed to ACCEPT_CONTEXT.
 
 If the name is omitted, it will look for 
- - a model object in $c->stash{current_model_instance}, then
+ - a model object in $c->stash->{current_model_instance}, then
  - a model name in $c->stash->{current_model}, then
  - a config setting 'default_model', or
  - check if there is only one model, and return it if that's the case.
@@ -578,7 +583,7 @@ Gets a L<Catalyst::View> instance by name.
 Any extra arguments are directly passed to ACCEPT_CONTEXT.
 
 If the name is omitted, it will look for 
- - a view object in $c->stash{current_view_instance}, then
+ - a view object in $c->stash->{current_view_instance}, then
  - a view name in $c->stash->{current_view}, then
  - a config setting 'default_view', or
  - check if there is only one view, and return it if that's the case.
@@ -1906,6 +1911,11 @@ search paths, specify a key named C<search_extra> as an array
 reference. Items in the array beginning with C<::> will have the
 application class name prepended to them.
 
+All components found will also have any 
+L<Devel::InnerPackage|inner packages> loaded and set up as components.
+Note, that modules which are B<not> an I<inner package> of the main
+file namespace loaded will not be instantiated as components.
+
 =cut
 
 sub setup_components {
@@ -2411,13 +2421,15 @@ Wiki:
 
 =head2 L<Catalyst::Test> - The test suite.
 
-=head1 CREDITS
+=head1 PROJECT FOUNDER
+
+sri: Sebastian Riedel <sri@cpan.org>
 
-Andy Grundman
+=head1 CONTRIBUTORS
 
-Andy Wardley
+abw: Andy Wardley
 
-Andreas Marienborg
+acme: Leon Brocard <leon@astray.com>
 
 Andrew Bramble
 
@@ -2425,65 +2437,67 @@ Andrew Ford
 
 Andrew Ruthven
 
-Arthur Bergman
+andyg: Andy Grundman <andy@hybridized.org>
 
-Autrijus Tang
+audreyt: Audrey Tang
 
-Brian Cassidy
+bricas: Brian Cassidy <bricas@cpan.org>
 
-Carl Franks
+chansen: Christian Hansen
 
-Christian Hansen
+chicks: Christopher Hicks
 
-Christopher Hicks
+dkubb: Dan Kubb <dan.kubb-cpan@onautopilot.com>
 
-Dan Sully
-
-Danijel Milicevic
+Drew Taylor
 
-David Kamholz
+esskar: Sascha Kiefer
 
-David Naughton
+fireartist: Carl Franks <cfranks@cpan.org>
 
-Drew Taylor
+gabb: Danijel Milicevic
 
 Gary Ashton Jones
 
 Geoff Richards
 
-Jesse Sheidlower
-
-Jesse Vincent
+jcamacho: Juan Camacho
 
 Jody Belka
 
 Johan Lindstrom
 
-Juan Camacho
+jon: Jon Schutz <jjschutz@cpan.org>
 
-Leon Brocard
+marcus: Marcus Ramberg <mramberg@cpan.org>
 
-Marcus Ramberg
+miyagawa: Tatsuhiko Miyagawa <miyagawa@bulknews.net>
 
-Matt S Trout
+mst: Matt S. Trout <mst@shadowcatsystems.co.uk>
 
-Robert Sedlacek
+mugwump: Sam Vilain
 
-Sam Vilain
+naughton: David Naughton
 
-Sascha Kiefer
+ningu: David Kamholz <dkamholz@cpan.org>
 
-Sebastian Willert
+nothingmuch: Yuval Kogman <nothingmuch@woobling.org>
 
-Tatsuhiko Miyagawa
+numa: Dan Sully <daniel@cpan.org>
 
-Ulf Edvinsson
+obra: Jesse Vincent
+
+omega: Andreas Marienborg
 
-Yuval Kogman
+phaylon: Robert Sedlacek <phaylon@dunkelheit.at>
 
-=head1 AUTHOR
+sky: Arthur Bergman
+
+the_jester: Jesse Sheidlower
+
+Ulf Edvinsson
 
-Sebastian Riedel, C<sri@oook.de>
+willert: Sebastian Willert <willert@cpan.org>
 
 =head1 LICENSE