From: Dan Brook Date: Sun, 22 May 2011 16:22:01 +0000 (+0200) Subject: Provide .psgi for Plack goodness. X-Git-Tag: 0.003002~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FGitalist.git;a=commitdiff_plain;h=cc02cf5a840f9f104af48f466ce29e9cffe9be87 Provide .psgi for Plack goodness. The .psgi was written by franky (Francoise Dehinbo) and gist-ed by Ranguard (Leo Lapworth). I've tweaked it to play nice with checkouts and "make install". --- diff --git a/Makefile.PL b/Makefile.PL index efb6e76..1bf9848 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -131,7 +131,7 @@ if ($ENV{GITALIST_RELEASE_TESTING}) { author_requires('WWW::Mechanize::TreeBuilder'); } -install_script glob('script/*.pl'); +install_script glob('script/*.p{l,sgi}'); auto_install; { # Make sure you REALLY REALLY have to have the env variable set to run diff --git a/lib/Gitalist.pm b/lib/Gitalist.pm index bd2f533..a0aa3fd 100644 --- a/lib/Gitalist.pm +++ b/lib/Gitalist.pm @@ -204,6 +204,14 @@ This example can be seen live here: http://example.gitalist.com +=head2 Plack + +If you would like to run Gitalist under L then one need only +make use of L and the +C<.psgi> found under C: + + plackup script/gitalist_app.psgi + =head1 CONFIGURATION The Gitalist config is loaded with L diff --git a/script/gitalist_app.psgi b/script/gitalist_app.psgi new file mode 100644 index 0000000..4a846e4 --- /dev/null +++ b/script/gitalist_app.psgi @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +use strict; + +use FindBin; +BEGIN { + my $env = "$FindBin::Bin/env"; + if (-r $env) { + do $env or die $@; + } +} + +use Gitalist; +use Plack::Builder; + +Gitalist->setup_engine('PSGI'); +my $app = sub { Gitalist->run(@_) }; + +builder { $app };