From: John Napiorkowski Date: Fri, 26 Sep 2014 16:42:43 +0000 (-0500) Subject: to_app alias X-Git-Tag: 5.90079_001~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=460bb45ba7f4694c2cbb4f1992f14cd9a34b77f7 to_app alias --- diff --git a/Changes b/Changes index 5c246ec..a9ed970 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ # This file documents the revision history for Perl extension Catalyst. +5.90080_001 - TBD + - MyApp->to_app is now an alias for MyApp->psgi_app in order to better support + existing Plack conventions. + 5.90073 - 2014-09-23 - Fixed a regression caused by the last release where we broke what happened when you tried to set request parameters via $c->req->param('foo', 'bar'). diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b904aa7..23ac3ad 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -127,7 +127,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90073'; +our $VERSION = '5.90080_001'; sub import { my ( $class, @arguments ) = @_; @@ -2993,7 +2993,9 @@ sub apply_default_middlewares { return $psgi_app; } -=head2 $c->psgi_app +=head2 App->psgi_app + +=head2 App->to_app Returns a PSGI application code reference for the catalyst application C<$c>. This is the bare application without any middlewares @@ -3004,6 +3006,8 @@ reference of your Catalyst application for use in F<.psgi> files. =cut +*to_app = \&psgi_app; + sub psgi_app { my ($app) = @_; my $psgi = $app->engine->build_psgi_app($app); diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm index fa9b74b..a8da289 100644 --- a/lib/Catalyst/Runtime.pm +++ b/lib/Catalyst/Runtime.pm @@ -7,7 +7,7 @@ BEGIN { require 5.008003; } # Remember to update this in Catalyst as well! -our $VERSION = '5.90073'; +our $VERSION = '5.90080_001'; =head1 NAME diff --git a/t/aggregate/to_app.t b/t/aggregate/to_app.t new file mode 100644 index 0000000..7bcb497 --- /dev/null +++ b/t/aggregate/to_app.t @@ -0,0 +1,11 @@ +use strict; +use warnings; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use TestApp; +use Test::More; + +ok(TestApp->can('to_app')); +is(ref(TestApp->to_app), 'CODE'); + +done_testing;