sukria/Dancer-Plugin-REST — Issue #9: Dancer::Plugin::Rest uses deprecated before call
Author: teamsterjr
Created: 2011-11-01 12:47:58+00:00
State: open

see this:
https://rt.cpan.org/Public/Bug/Display.html?id=72085

When restarting an app using Dancer::Plugin::Rest I get the following warning:

[Tue Nov 01 11:31:32 2011] [warn] [] H::Dispatcher::__ANON__(21) Dancer::before has been deprecated since version 1.3080. use hooks! at /usr/lib/perl5/site_perl/5.8.8/Dancer.pm line 110

the plugin needs to use hooks:

diff -u -r a/lib/Dancer/Plugin/REST.pm b/lib/Dancer/Plugin/REST.pm
--- a/lib/Dancer/Plugin/REST.pm	2011-05-28 14:30:42.000000000 +0100
+++ b/lib/Dancer/Plugin/REST.pm	2011-11-01 11:39:31.000000000 +0000
@@ -27,7 +27,7 @@
}
);

- before sub {
+ hook before => sub {
my $format = params->{'format'};
return unless defined $format;