# always assume anything to do with files or directories is ran at project root
-no warnings;
-
use constant {
# If you're using lighttpd, set this to 1
IMMORTAL => 1, # will continue handling request after death/error
+LOG_FILE => '/tmp/gorillanest.log',
DB_FILE => 'gorillanest.sqlite3', # sqlite3
SOCKET_FILE => '/tmp/gorillanest.socket',
use Git::Repository;
use lib qw(. ..);
-BEGIN { require 'config.default.pl'; }
-BEGIN { require 'config.pl' if -f 'config.pl'; }
+BEGIN {
+ # ignores redefinition... and everything else
+ open my $stderr, '>&', \*STDERR;
+ open STDERR, '>', '/dev/null';
+ require 'config.default.pl';
+ require 'config.pl' if -f 'config.pl';
+ open STDERR, '>&', $stderr;
+}
sub info {
warn join(' ', @_);
my %data = (
found => 0,
-);
+ );
my %routes = (
'/' => sub { GN::index($root); },
'/~([\w.]+)' => sub { GN::user($root, @_) },
'/~([\w.]+)/([\w.]+)' => sub { GN::repository($root, @_) },
-);
+ );
my %route_regex_cache = map { $_ => qr{^$_$} } keys %routes;
sub master {