X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=plack%2Flib%2FPlack%2FApp%2FBookReader.pm;h=f3f26f32c77c8c76ea0efdafb1c075757b2066bf;hb=58cceebf12bef2963f1da327d4e8344359add18e;hp=0c07304c00853e788dc849d99e558483b79513a4;hpb=1652f5a0c2d3f14967c6fe2096a821bdc7ab17e9;p=bookreader.git diff --git a/plack/lib/Plack/App/BookReader.pm b/plack/lib/Plack/App/BookReader.pm index 0c07304..f3f26f3 100644 --- a/plack/lib/Plack/App/BookReader.pm +++ b/plack/lib/Plack/App/BookReader.pm @@ -9,8 +9,20 @@ use DirHandle; use URI::Escape; use Plack::Request; use Data::Dump qw(dump); -use File::Path qw(make_path); +use File::Path; use Graphics::Magick; +use File::Slurp; +use Image::Size; +use JSON; +use Time::Piece (); +use Time::Seconds 'ONE_YEAR'; + +sub make_basedir { + my $path = shift; + return if -e $path; + $path =~ s{/[^/]+$}{} || die "no dir/file in $path"; + File::Path::make_path $path; +} # Stolen from rack/directory.rb my $dir_file = "