Make restarters immutable handling less naive + tests
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 3cb06ea..ae8946f 100644 (file)
@@ -10,10 +10,10 @@ use Catalyst::Action;
 use Catalyst::ActionContainer;
 use Catalyst::DispatchType::Default;
 use Catalyst::DispatchType::Index;
+use Catalyst::Utils;
 use Text::SimpleTable;
 use Tree::Simple;
 use Tree::Simple::Visitor::FindByPath;
-use Scalar::Util ();
 
 # Refactoring note:
 # do these belong as package vars or should we build these via a builder method?
@@ -146,7 +146,7 @@ sub _command2action {
 
     # go to a string path ("/foo/bar/gorch")
     # or action object
-    if (Scalar::Util::blessed($command) && $command->isa('Catalyst::Action')) {
+    if (blessed($command) && $command->isa('Catalyst::Action')) {
         $action = $command;
     }
     else {
@@ -583,10 +583,9 @@ sub setup_actions {
 
     return unless $c->debug;
 
+    my $column_width = Catalyst::Utils::term_width() - 20 - 36 - 12;
     my $privates = Text::SimpleTable->new(
-        [ 20, 'Private' ],
-        [ 36, 'Class' ],
-        [ 12, 'Method' ]
+        [ 20, 'Private' ], [ 36, 'Class' ], [ $column_width, 'Method' ]
     );
 
     my $has_private = 0;
@@ -666,7 +665,7 @@ foreach my $public_method_name (qw/
         my %package_hash; # Only warn once per method, per package. These are infrequent enough that
                           # I haven't provided a way to disable them, patches welcome.
         $meta->add_before_method_modifier($public_method_name, sub {
-            my $class = Scalar::Util::blessed(shift);
+            my $class = blessed(shift);
             $package_hash{$class}++ || do { 
                 warn("Class $class is calling the deprecated method Catalyst::Dispatcher::$public_method_name,\n"
                     . "this will be removed in Catalyst 5.9X");