Skip to content

Commit

Permalink
removed experimental status from around_dispatch hook
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 18, 2012
1 parent 7016647 commit fc0292a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,6 +1,9 @@
This file documents the revision history for Perl extension Mojolicious.

2.51 2012-02-18 00:00:00
- Removed experimental status from around_dispatch hook.
- Removed experimental status from emit_chain method in
Mojolicious::Plugins.
- Improved portability of scripts.
- Improved documentation.

Expand Down
23 changes: 4 additions & 19 deletions lib/Mojolicious.pm
Expand Up @@ -154,16 +154,14 @@ sub handler {
weaken $c->{tx};

# Dispatcher
unless ($self->{dispatcher}) {
unless ($self->{dispatch}) {
$self->hook(
around_dispatch => sub {
my ($next, $c) = @_;

# DEPRECATED in Leaf Fluttering In Wind!
$self->on_process->($c->app, $c);
$c->app->dispatch($c);
}
);
$self->{dispatcher}++;
$self->{dispatch}++;
}

# Process
Expand Down Expand Up @@ -195,18 +193,6 @@ sub helper {
# Santa Claus is gunning you down!"
sub hook { shift->plugins->on(@_) }

# DEPRECATED in Leaf Fluttering In Wind!
sub on_process {
my ($self, $cb) = @_;
return $self->{on_process} ||= sub { shift->dispatch(@_) }
unless $cb;
warn <<EOF;
Mojolicious->on_process is DEPRECATED in favor of the around_dispatch hook!
EOF
$self->{on_process} = $cb;
return $self;
}

sub plugin {
my $self = shift;
$self->plugins->register_plugin(shift, $self, @_);
Expand Down Expand Up @@ -512,8 +498,7 @@ instance)
Emitted right before the C<before_dispatch> hook and wraps around the whole
dispatch process, so you have to manually forward to the next hook if you
want to continue the chain. Note that this hook is EXPERIMENTAL and might
change without warning!
want to continue the chain.
$app->hook(around_dispatch => sub {
my ($next, $c) = @_;
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojolicious/Plugins.pm
Expand Up @@ -111,8 +111,7 @@ implements the following new ones.
$plugins = $plugins->emit_chain('foo');
$plugins = $plugins->emit_chain(foo => 123);
Emit events as chained hooks. Note that this method is EXPERIMENTAL and might
change without warning!
Emit events as chained hooks.
=head2 C<emit_hook>
Expand Down
4 changes: 2 additions & 2 deletions t/pod_coverage.t
Expand Up @@ -9,8 +9,8 @@ plan skip_all => 'set TEST_POD to enable this test (developer only!)'

# DEPRECATED in Leaf Fluttering In Wind!
my @leaf = (
qw/comment keep_alive_timeout max_redirects on_process port/,
qw/prepare_ioloop root version x_forwarded_for/
qw/comment keep_alive_timeout max_redirects port prepare_ioloop root/,
qw/version x_forwarded_for/
);

# "Marge, I'm going to miss you so much. And it's not just the sex.
Expand Down

0 comments on commit fc0292a

Please sign in to comment.