From f4b3b90c3ccef7deb127c3ea1fc46984d64db605 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 18 Feb 2011 11:55:34 -0600 Subject: make the dsn externally settable --- lib/Narwhal.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Narwhal.pm b/lib/Narwhal.pm index 5f0eff3..0a7a24e 100644 --- a/lib/Narwhal.pm +++ b/lib/Narwhal.pm @@ -4,7 +4,16 @@ use Narwhal::RouteBuilder::HTTPMethod; with 'OX::Role::WithAppRoot'; -config kioku_dsn => 'dbi:SQLite:narwhal.db'; +has dsn => ( + is => 'ro', + isa => 'Str', + default => 'dbi:SQLite:narwhal.db', +); + +config kioku_dsn => sub { + my ($s, $app) = @_; + $app->dsn; +}; config kioku_extra_args => sub { { create => 1 } }; config template_root => sub { shift->param('app_root')->subdir('root', 'templates') -- cgit v1.2.3