Veure on Plack

chromatic was complaining about how tightly coupled the Veure test suite is with Catalyst. That was bugging me, too, but since I didn't yet have a compelling reason to fix this, I didn't. That was before I saw Miyagawa's Plack talk at OSCON 2010.

So I ran this:

perl script/veure_create.pl PSGI

And it created a little $VEURE_HOME/script/veure.psgi file for me. Then I just ran:

plackup -r -s Starman script/veure.psgi

And now Veure is running on PSGI! The "-r" is a normal reload switch (useful in development) and the "-s" tells plackup that I was to use the fast Starman server.

Fairly quickly I modified my veure.psgi file to look like this:

#!/usr/bin/env perl
use strict;
use warnings;
use Veure;
use Plack::Builder;

Veure->setup_engine('PSGI');
my $app = sub { Veure->run(@_) };

builder {
    enable 'Debug', panels => [qw(DBITrace Memory Timer Environment)];
    $app;
};

With that, I now have a lovely debug panel running down the right side of the Veure app telling me all sorts of interesting things about every request.

Next up will involve converting my tests to use Plack::Test for my controller tests. In fact, if all goes well, I might even write a custom Test::Class subclass to remove some of the boilerplate (I'm awfully repetitive about removing boilerplate. Hmm ...)

Who knows? chromatic might carry out his threat to strip Catalyst and reimplement Veure on Dancer. I've resisted it because Catalyst is so much more mature and I know it scales well. I am, however, very, very tempted ...

2 Comments

Leave a comment

About Ovid

user-pic Have Perl; Will Travel. Freelance Perl/Testing/Agile consultant. Photo by http://www.circle23.com/. Warning: that site is not safe for work. The photographer is a good friend of mine, though, and it's appropriate to credit his work.