Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move to_app auto promotion to Builder instead of load_psgi

  • Loading branch information...
commit ec6d32c91c5409ea44b7be212b4b404c4a66b59e 1 parent b2455e1
Tatsuhiko Miyagawa miyagawa authored
Showing with 3 additions and 1 deletion.
  1. +3 −0  lib/Plack/Builder.pm
  2. +0 −1  lib/Plack/Util.pm
3  lib/Plack/Builder.pm
View
@@ -6,6 +6,7 @@ our @EXPORT = qw( builder add enable enable_if mount );
use Carp ();
use Plack::App::URLMap;
use Plack::Middleware::Conditional; # TODO delayed load?
+use Scalar::Util ();
sub new {
my $class = shift;
@@ -123,6 +124,8 @@ sub builder(&) {
}
}
+ $app = $app->to_app if $app and Scalar::Util::blessed($app) and $app->can('to_app');
+
$self->to_app($app);
}
1  lib/Plack/Util.pm
View
@@ -133,7 +133,6 @@ sub load_psgi {
my $app = _load_sandbox($file);
die "Error while loading $file: $@" if $@;
- return $app->to_app if $app and Scalar::Util::blessed($app) and $app->can('to_app');
return $app;
}
Please sign in to comment.
Something went wrong with that request. Please try again.