X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=ae8946f593a6b3c530df38b245c93d91edd85104;hb=65b708a697de08be81bf212704d495e8cad41ed2;hp=3cb06eabe863cc32435cd4c6b48532a5ed330438;hpb=12f0342e49c1b2af2e71c30aa4dcfbac0b7735c2;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 3cb06ea..ae8946f 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -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");