From 448b052be000b337f18e761886aca87f3fddaedf Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 22 Jan 2018 13:48:33 +0100 Subject: [PATCH] rel_dir is replaced with rel_file --- lib/MojoFacets/Changes.pm | 2 +- lib/MojoFacets/Code.pm | 2 +- lib/MojoFacets/Data.pm | 12 ++++++------ lib/MojoFacets/Gnuplot.pm | 2 +- lib/MojoFacets/Profile.pm | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/MojoFacets/Changes.pm b/lib/MojoFacets/Changes.pm index ca22b4e..c1ddc04 100644 --- a/lib/MojoFacets/Changes.pm +++ b/lib/MojoFacets/Changes.pm @@ -12,7 +12,7 @@ use MojoFacets::Data; sub _changes_path { my $self = shift; my $path = $self->param('path') || $self->session('path'); - $self->app->home->rel_dir('data') . '/' . $path . '.changes'; + $self->app->home->rel_file('data') . '/' . $path . '.changes'; } sub _hash_eq { diff --git a/lib/MojoFacets/Code.pm b/lib/MojoFacets/Code.pm index 29b4a76..64ce144 100644 --- a/lib/MojoFacets/Code.pm +++ b/lib/MojoFacets/Code.pm @@ -8,7 +8,7 @@ use base 'Mojolicious::Controller'; use Data::Dump qw(dump); use File::Slurp; -sub _code_dir { $_[0]->app->home->rel_dir('public') . '/code' } +sub _code_dir { $_[0]->app->home->rel_file('public') . '/code' } sub index { my $self = shift; diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 37f1f21..cd78d26 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -61,7 +61,7 @@ our $filters; sub index { my $self = shift; - my $data_dir = $self->app->home->rel_dir('data'); + my $data_dir = $self->app->home->rel_file('data'); die "no data dir $data_dir" unless -d $data_dir; my @files; @@ -98,7 +98,7 @@ sub index { sub _dump_path { my ( $self, $name ) = @_; - my $dir = $self->app->home->rel_dir('data'); + my $dir = $self->app->home->rel_file('data'); $name =~ s/^$dir//; $name =~ s/\/+/_/g; return '/tmp/mojo_facets.' . $name . '.storable'; @@ -357,7 +357,7 @@ sub _checked { sub _permanent_path { my $self = shift; my $path = $self->_param_or_session('path'); - $self->app->home->rel_dir('data') . '/' . join('.', $path, @_); + $self->app->home->rel_file('data') . '/' . join('.', $path, @_); } sub __unac { @@ -383,7 +383,7 @@ sub _export_path { warn "no path in param or session"; return; } - my $dir = $self->app->home->rel_dir('public') . "/export/$path"; + my $dir = $self->app->home->rel_file('public') . "/export/$path"; mkpath $dir unless -e $dir; my $name = __export_path_name( $path, @_ ); my $full = $dir . '/' . $name; @@ -835,7 +835,7 @@ sub items { } } - my $code_path = $self->app->home->rel_dir('public') . "/code"; + my $code_path = $self->app->home->rel_file('public') . "/code"; if ( $commit ) { __path_modified( $path, 'commit' ); @@ -1295,7 +1295,7 @@ sub save { sub export { my $self = shift; - my $dir = $self->app->home->rel_dir('public'); + my $dir = $self->app->home->rel_file('public'); if ( my $import = $self->param('import') ) { diff --git a/lib/MojoFacets/Gnuplot.pm b/lib/MojoFacets/Gnuplot.pm index fc79de5..14a39ed 100644 --- a/lib/MojoFacets/Gnuplot.pm +++ b/lib/MojoFacets/Gnuplot.pm @@ -28,7 +28,7 @@ sub index { warn "# name $name\n"; my $url = "/export/$path/$name"; - my $dir = $self->app->home->rel_dir('public'); + my $dir = $self->app->home->rel_file('public'); if ( -e "$dir/$url" ) { diff --git a/lib/MojoFacets/Profile.pm b/lib/MojoFacets/Profile.pm index 3f1fdd2..5fd8bc2 100644 --- a/lib/MojoFacets/Profile.pm +++ b/lib/MojoFacets/Profile.pm @@ -15,7 +15,7 @@ sub index { if ( my $profile = $self->param('profile') ) { warn "XXX profile $profile\n"; - my $dir = $self->app->home->rel_dir('public') . "/profile/$profile"; + my $dir = $self->app->home->rel_file('public') . "/profile/$profile"; if ( ! -e $dir ) { mkpath $dir unless -d $dir; system "nytprofhtml --file $path$profile --out $dir"; @@ -35,7 +35,7 @@ sub remove { if ( my $profile = $self->param('profile') ) { unlink "/tmp/MojoFacets.profile.$profile"; - rmtree $self->app->home->rel_dir('public') . "/profile/$profile"; + rmtree $self->app->home->rel_file('public') . "/profile/$profile"; } return $self->redirect_to('/profile'); -- 2.20.1