Backport failing test into 5.70 trunk
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index f3701d6..8b8cb3f 100644 (file)
@@ -64,7 +64,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.7099_04';
+our $VERSION = '5.71000';
 
 sub import {
     my ( $class, @arguments ) = @_;
@@ -956,7 +956,8 @@ EOF
         my @plugins = map { "$_  " . ( $_->VERSION || '' ) } $class->registered_plugins;
 
         if (@plugins) {
-            my $t = Text::SimpleTable->new(74);
+            my $column_width = Catalyst::Utils::term_width() - 6;
+            my $t = Text::SimpleTable->new($column_width);
             $t->row($_) for @plugins;
             $class->log->debug( "Loaded plugins:\n" . $t->draw . "\n" );
         }
@@ -988,7 +989,8 @@ EOF
     $class->setup_components;
 
     if ( $class->debug ) {
-        my $t = Text::SimpleTable->new( [ 63, 'Class' ], [ 8, 'Type' ] );
+        my $column_width = Catalyst::Utils::term_width() - 8 - 9;
+        my $t = Text::SimpleTable->new( [ $column_width, 'Class' ], [ 8, 'Type' ] );
         for my $comp ( sort keys %{ $class->components } ) {
             my $type = ref $class->components->{$comp} ? 'instance' : 'class';
             $t->row( $comp, $type );
@@ -1020,10 +1022,18 @@ EOF
 =item $action
 
 A Catalyst::Action object representing the Catalyst action you want to
-create a URI for. To get one for an action in the current controller,
-use C<< $c->action('someactionname') >>. To get one from different
-controller, fetch the controller using C<< $c->controller() >>, then
-call C<action_for> on it.
+create a URI for. 
+
+To get an action object:
+
+  From another controller, anywhere:
+    C<< $c->controller('ControllerName')->action_for('someactionname') >>
+  Shorter styles useful in particular places:
+    In the current controller's action method:
+      C<< $self->action_for('someactionname') >>
+    From the view for currently dispatched action: 
+      C<< $c->controller->action_for('someactionname') >>
+
 
 This method must be used to create URIs for
 L<Catalyst::DispatchType::Chained> actions.
@@ -1055,7 +1065,7 @@ to the URI, with the keys as the names, and the values as the values.
 Returns a L<URI> object.
 
   ## Ex 1: a path with args and a query parameter
-  $c->uri_for('user/list', 'short', { page => 2});
+  $c->uri_for($c->controller('User')->action_for('list'), 'short', { page => 2});
   ## -> ($c->req->base is 'http://localhost:3000/'
   URI->new('http://localhost:3000/user/list/short?page=2)
 
@@ -1070,6 +1080,11 @@ Returns a L<URI> object.
   ## outputs:
   URI->new('http://localhost:3000/myuser/42/view')
 
+  ## Ex 3: this style is deprecated and should be omitted
+  $c->uri_for('user/list', 'short', { page => 2});
+  ## -> ($c->req->base is 'http://localhost:3000/'
+  URI->new('http://localhost:3000/user/list/short?page=2)
+
 Creates a URI object using C<< $c->request->base >> and a path. If an
 Action object is given instead of a path, the path is constructed
 using C<< $c->dispatcher->uri_for_action >> and passing it the
@@ -1264,7 +1279,7 @@ sub welcome_message {
                     they can save you a lot of work.</p>
                     <pre><code>script/${prefix}_create.pl -help</code></pre>
                     <p>Also, be sure to check out the vast and growing
-                    collection of <a href="http://cpansearch.perl.org/search?query=Catalyst%3A%3APlugin%3A%3A&amp;mode=all">plugins for Catalyst on CPAN</a>;
+                    collection of <a href="http://search.cpan.org/search?query=Catalyst">plugins for Catalyst on CPAN</a>;
                     you are likely to find what you need there.
                     </p>
 
@@ -2589,6 +2604,8 @@ obra: Jesse Vincent
 
 omega: Andreas Marienborg
 
+Oleg Kostyuk <cub.uanic@gmail.com>
+
 phaylon: Robert Sedlacek <phaylon@dunkelheit.at>
 
 sky: Arthur Bergman