From: Matt S Trout Date: Sun, 23 Oct 2011 03:44:42 +0000 (+0000) Subject: add checkall dev command to look for botched pages X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d4b40273d67be09df9473089cb5343d10c40181;p=scpubgit%2FSCS.git add checkall dev command to look for botched pages --- diff --git a/lib/SCSite/DevMode.pm b/lib/SCSite/DevMode.pm index e0f446a..e33ab23 100644 --- a/lib/SCSite/DevMode.pm +++ b/lib/SCSite/DevMode.pm @@ -2,6 +2,7 @@ package SCSite::DevMode; use Plack::App::File; use Plack::Runner; +use Try::Tiny; use Moo::Role; has _static_handler => (is => 'lazy'); @@ -30,4 +31,18 @@ sub _run_dev_server { $r->run; } +sub _run_dev_checkall { + my ($self) = @_; + my $ps = $self->pages; + foreach my $path ($ps->all_paths) { + try { + $ps->get({ path => $path }); + print "OK ${path}\n"; + } catch { + print "ERROR ${path}\n"; + print " $_"; + }; + } +} + 1;