From: Matt S Trout Date: Sat, 27 Nov 2010 16:01:20 +0000 (+0000) Subject: update for new Web::Simple X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FApp-IdiotBox.git;a=commitdiff_plain;h=8b9d3d54830e9a5211821f593737ff60c5b688de update for new Web::Simple --- diff --git a/lib/App/IdiotBox.pm b/lib/App/IdiotBox.pm index c91d6c8..88e90c6 100644 --- a/lib/App/IdiotBox.pm +++ b/lib/App/IdiotBox.pm @@ -41,13 +41,13 @@ use List::Util qw(first); } } -default_config( +sub default_config { template_dir => 'share/html', store => 'SQLite', db_file => 'var/lib/idiotbox.db', base_url => 'http://localhost:3000/', base_dir => do { use FindBin; $FindBin::Bin }, -); +} sub BUILD { my $self = shift; @@ -60,20 +60,19 @@ sub BUILD { $store_class->bind($self); } -dispatch { +sub dispatch_request { + my $self = shift; sub (/) { $self->show_front_page }, - subdispatch sub (/*/...) { + sub (/*/...) { my $bucket = $self->buckets->get({ slug => $_[1] }); - [ - sub (/) { - $self->show_bucket($bucket) - }, - sub (/*/) { - $self->show_video($bucket->videos->get({ slug => $_[1] })); - } - ] + sub (/) { + $self->show_bucket($bucket) + }, + sub (/*/) { + $self->show_video($bucket->videos->get({ slug => $_[1] })); + } } -}; +} sub recent_announcements { shift->{recent_announcements} }