X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FWeb%2FSimple%2FApplication.pm;h=f72142a20e413266c29cde3bdf461ae8bc097049;hb=beb7eb96f1ae4dc19c3ed4f38359c7549ae62b99;hp=1ec59aafc59dc929abe66925cbff5460edf41fc2;hpb=5b8f03a796aeb5b65d1c798058eafcaa1e55b00e;p=catagits%2FWeb-Simple.git diff --git a/lib/Web/Simple/Application.pm b/lib/Web/Simple/Application.pm index 1ec59aa..f72142a 100644 --- a/lib/Web/Simple/Application.pm +++ b/lib/Web/Simple/Application.pm @@ -25,7 +25,6 @@ has '_dispatcher' => (is => 'lazy'); sub _build__dispatcher { my $self = shift; require Web::Dispatch; - require Web::Simple::DispatchNode; my $final = $self->_build_final_dispatcher; # We need to weaken both the copy of $self that the @@ -37,13 +36,12 @@ sub _build__dispatcher { # closes back over $self weaken($self); - my $node_args = { app_object => $self }; - weaken($node_args->{app_object}); - Web::Dispatch->new( - app => sub { $self->dispatch_request(@_), $final }, - node_class => 'Web::Simple::DispatchNode', - node_args => $node_args + my %dispatch_args = ( + dispatch_app => sub { $self->dispatch_request(@_), $final }, + dispatch_object => $self ); + weaken($dispatch_args{dispatch_object}); + Web::Dispatch->new(%dispatch_args); } sub _build_final_dispatcher {