Skip to content

Commit

Permalink
Merge branch 'feature/deprecation-warnings'
Browse files Browse the repository at this point in the history
  • Loading branch information
cromedome committed Mar 14, 2022
2 parents a41552b + 6e1e006 commit bb4b370
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 33 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{{$NEXT}}

0.400000 2022-03-13 22:16:13-04:00 America/New_York

[ BUG FIXES ]
* PR #1634: Fix CI push setting to run tests on branches with / in the
name (Stefan Hornburg - Racke)
Expand Down
18 changes: 16 additions & 2 deletions README.mkdn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Dancer2 - Lightweight yet powerful web application framework

# VERSION

version 0.301004
version 0.400000

# DESCRIPTION

Expand Down Expand Up @@ -73,6 +73,20 @@ complete outline on where to go for help.
[Dancer2::Manual::Migration](https://metacpan.org/pod/Dancer2%3A%3AManual%3A%3AMigration) provides the most up-to-date instruction on
how to convert a Dancer (1) based application to Dancer2.

### Other Documentation

- Git Guide

The [Git guide](https://metacpan.org/pod/GitGuide) describes how to set up your development environment to contribute
to the development of Dancer2, Dancer2's Git workflow, submission guidelines, and
various coding standards.

- Deprecation Policy

The [deprecation policy](https://metacpan.org/pod/Dancer2%3A%3ADeprecationPolicy) defines the process for removing old,
broken, unused, or outdated code from the Dancer2 codebase. This policy is critical
for guiding and shaping future development of Dancer2.

# FUNCTIONS

## my $runner=runner();
Expand Down Expand Up @@ -268,7 +282,7 @@ Dancer Core Developers

# COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Alexis Sukrieh.
This software is copyright (c) 2022 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
4 changes: 2 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name = Dancer2
author = Dancer Core Developers
license = Perl_5
copyright_holder = Alexis Sukrieh
copyright_year = 2021
copyright_year = 2022
main_module = lib/Dancer2.pm

version = 0.301004
version = 0.400000

[NextRelease]
filename = Changes
Expand Down
11 changes: 4 additions & 7 deletions lib/Dancer2/Core/DSL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ sub status {
}

sub push_header {
# TODO: deprecate old keyword after we have a period of stability
# carp "DEPRECATED: please use the 'push_response_header' keyword instead of 'push_header'";
carp "DEPRECATED: push_header keyword. Please use the 'push_response_header' keyword instead of 'push_header'";
goto &push_response_header;
}

Expand All @@ -292,8 +291,7 @@ sub push_response_header {
}

sub header {
# TODO: deprecate keyword after a period of stability
# carp "DEPRECATED: please use the 'response_header' keyword instead of 'header'";
carp "DEPRECATED: header keyword. Please use the 'response_header' keyword instead of 'header'";
goto &response_header;
}

Expand All @@ -303,8 +301,7 @@ sub response_header {
}

sub headers {
# TODO: deprecate keyword after a period of stability
# carp "DEPRECATED: please use the 'response_headers' keyword instead of 'headers'";
carp "DEPRECATED: headers keyword. Please use the 'response_headers' keyword instead of 'headers'";
goto &response_headers;
}

Expand Down Expand Up @@ -405,7 +402,7 @@ sub pass { shift->app->pass }
#

sub context {
carp "DEPRECATED: please use the 'app' keyword instead of 'context'";
carp "DEPRECATED: context keyword. Please use the 'app' keyword instead of 'context'";
shift->app;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Dancer2/Core/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ sub uri_base {
}

sub dispatch_path {
warn q{request->dispatch_path is deprecated};
warn q{DEPRECATED: request->dispatch_path. Please use request->path instead};
return shift->path;
}

Expand Down
16 changes: 8 additions & 8 deletions lib/Dancer2/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -433,32 +433,32 @@ END
# FIXME: AUTOLOAD might pick up on this
sub dancer_app {
Carp::carp "Plugin DSL method 'dancer_app' is deprecated. "
. "Use '\\\$self->app' instead'.\n";
Carp::carp "DEPRECATED: Plugin DSL method 'dancer_app'. "
. "Please use '\\\$self->app' instead'.\n";
\$_[0]->app;
}
# FIXME: AUTOLOAD might pick up on this
sub request {
Carp::carp "Plugin DSL method 'request' is deprecated. "
. "Use '\\\$self->app->request' instead'.\n";
Carp::carp "DEPRECATED: Plugin DSL method 'request'. "
. "Please use '\\\$self->app->request' instead'.\n";
\$_[0]->app->request;
}
# FIXME: AUTOLOAD might pick up on this
sub var {
Carp::carp "Plugin DSL method 'var' is deprecated. "
. "Use '\\\$self->app->request->var' instead'.\n";
Carp::carp "DEPRECATED: Plugin DSL method 'var'. "
. "Please use '\\\$self->app->request->var' instead'.\n";
shift->app->request->var(\@_);
}
# FIXME: AUTOLOAD might pick up on this
sub hook {
Carp::carp "Plugin DSL method 'hook' is deprecated. "
. "Use '\\\$self->app->add_hook' instead'.\n";
Carp::carp "DEPRECATED: Plugin DSL method 'hook'. "
. "Please use '\\\$self->app->add_hook' instead'.\n";
shift->app->add_hook(
Dancer2::Core::Hook->new( name => shift, code => shift ) );
Expand Down
26 changes: 13 additions & 13 deletions lib/Dancer2/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ our $NO_WARN = 0;
# or can be fed a response (which is passed through without
# any modification)
sub dancer_response {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;

_find_dancer_apps_for_dispatcher();
Expand Down Expand Up @@ -226,7 +226,7 @@ sub _build_env_from_request {

sub response_status_is {
my ( $req, $status, $test_name ) = @_;
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;

$test_name ||= "response status is $status for " . _req_label($req);
Expand Down Expand Up @@ -255,7 +255,7 @@ sub _find_route_match {
}

sub route_exists {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;

my $tb = Test::Builder->new;
Expand All @@ -264,7 +264,7 @@ sub route_exists {
}

sub route_doesnt_exist {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;

my $tb = Test::Builder->new;
Expand All @@ -275,7 +275,7 @@ sub route_doesnt_exist {
sub response_status_isnt {
my ( $req, $status, $test_name ) = @_;

carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;

$test_name ||= "response status is not $status for " . _req_label($req);
Expand Down Expand Up @@ -315,36 +315,36 @@ sub response_status_isnt {
}

sub response_content_is {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
local $Test::Builder::Level = $Test::Builder::Level + 1;
_cmp_response_content( @_, 'is_eq' );
}

sub response_content_isnt {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
local $Test::Builder::Level = $Test::Builder::Level + 1;
_cmp_response_content( @_, 'isnt_eq' );
}

sub response_content_like {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
local $Test::Builder::Level = $Test::Builder::Level + 1;
_cmp_response_content( @_, 'like' );
}

sub response_content_unlike {
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
local $Test::Builder::Level = $Test::Builder::Level + 1;
_cmp_response_content( @_, 'unlike' );
}

sub response_content_is_deeply {
my ( $req, $matcher, $test_name ) = @_;
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
$test_name ||= "response content looks good for " . _req_label($req);

Expand All @@ -355,7 +355,7 @@ sub response_content_is_deeply {

sub response_is_file {
my ( $req, $test_name ) = @_;
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
$test_name ||= "a file is returned for " . _req_label($req);

Expand All @@ -367,7 +367,7 @@ sub response_is_file {

sub response_headers_are_deeply {
my ( $req, $expected, $test_name ) = @_;
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
$test_name ||= "headers are as expected for " . _req_label($req);

Expand All @@ -382,7 +382,7 @@ sub response_headers_are_deeply {

sub response_headers_include {
my ( $req, $expected, $test_name ) = @_;
carp 'Dancer2::Test is deprecated, please use Plack::Test instead'
carp 'DEPRECATED: Dancer2::Test. Please use Plack::Test instead'
unless $NO_WARN;
$test_name ||= "headers include expected data for " . _req_label($req);
my $tb = Test::Builder->new;
Expand Down

0 comments on commit bb4b370

Please sign in to comment.