Skip to content

Commit

Permalink
use parent instead of Moose, finalize the response before returning it.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jan 27, 2012
1 parent ba70198 commit c567398
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wre/lib/WRE/WebguiDemo.pm
Expand Up @@ -19,8 +19,9 @@ use WebGUI::Config;
use WRE::Config;
use WRE::File;
use WRE::Mysql;
use Moose;

extends 'Plack::Component';
use parent 'Plack::Component';
use Plack::Util::Accessor qw/wre_config/;

#-------------------------------------------------------------------
Expand All @@ -31,7 +32,7 @@ sub call {
my $r = Plack::Request->new($env);
my ($id) = $r->uri->host =~ m/^\/(demo[0-9\_]+).*$/;
my $webgui_config = $config->getWebguiRoot("/etc/".$id.".conf");
$self->response($response);
my $response;
if (-e $webgui_config) {
## Code to use the WebGUI App with a particular config file.
local $ENV{WEBGUI_CONFIG} = $webgui_config;
Expand All @@ -46,6 +47,7 @@ sub call {
else {
$response = $self->prompt_demo();
}
return $response->finalize;
}


Expand Down

0 comments on commit c567398

Please sign in to comment.