X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=08652e5135b7eeb256e157b570fae5309de5d5dd;hb=269194b4f9de3905430a2d1f21f68da13b2b9ed9;hp=b0b3606b3adeea7950a830a688ee1e2d1da3a878;hpb=39fc2ce1e456c4e2a272204aa8fe67896984b3a6;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index b0b3606..08652e5 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -14,7 +14,6 @@ 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? @@ -102,7 +101,6 @@ it with a C<+>, like so: Delegate the dispatch to the action that matched the url, or return a message about unknown resource - =cut sub dispatch { @@ -110,7 +108,6 @@ sub dispatch { if ( my $action = $c->action ) { $c->forward( join( '/', '', $action->namespace, '_DISPATCH' ) ); } - else { my $path = $c->req->path; my $error = $path @@ -147,7 +144,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 { @@ -473,7 +470,7 @@ sub uri_for_action { return undef; } -=head2 expand_action +=head2 expand_action expand an action into a full representation of the dispatch. mostly useful for chained, other actions will just return a @@ -565,13 +562,15 @@ sub _find_or_create_namespace_node { =head2 $self->setup_actions( $class, $context ) +Loads all of the preload dispatch types, registers their actions and then +loads all of the postload dispatch types, and iterates over the tree of +actions, displaying the debug information if appropriate. =cut sub setup_actions { my ( $self, $c ) = @_; - my @classes = $self->_load_dispatch_types( @{ $self->preload_dispatch_types } ); @{ $self->_registered_dispatch_types }{@classes} = (1) x @classes; @@ -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");