From: Karen Etheridge Date: Sat, 28 May 2022 02:47:09 +0000 (-0700) Subject: remove use of File::HomeDir X-Git-Tag: v1.003029~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=commitdiff_plain;h=0b5d24302fd762cbe7a44c17ded49158ee5697da remove use of File::HomeDir replaced with shibboleth from File::HomeDir::Tiny --- diff --git a/Changes b/Changes index 38c398d..29335e3 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Devel-REPL {{ $NEXT }} + - removed File::HomeDir dependency 1.003028 2016-02-16 01:13:08Z - increase the required version of Data::Dump::Streamer (see RT#105466) diff --git a/lib/Devel/REPL/Plugin/ReadLineHistory.pm b/lib/Devel/REPL/Plugin/ReadLineHistory.pm index 6e2bf94..9cb893d 100644 --- a/lib/Devel/REPL/Plugin/ReadLineHistory.pm +++ b/lib/Devel/REPL/Plugin/ReadLineHistory.pm @@ -11,12 +11,11 @@ package Devel::REPL::Plugin::ReadLineHistory; our $VERSION = '1.003029'; use Devel::REPL::Plugin; -use File::HomeDir; use File::Spec; use namespace::autoclean; my $hist_file = $ENV{PERLREPL_HISTFILE} || - File::Spec->catfile(File::HomeDir->my_home, '.perlreplhist'); + File::Spec->catfile(($^O eq 'MSWin32' && "$]" < 5.016 ? $ENV{HOME} || $ENV{USERPROFILE} : (<~>)[0]), '.perlreplhist'); # HISTLEN should probably be in a config file to stop people accidentally # truncating their history if they start the program and forget to set diff --git a/lib/Devel/REPL/Script.pm b/lib/Devel/REPL/Script.pm index 6277632..5d7541b 100644 --- a/lib/Devel/REPL/Script.pm +++ b/lib/Devel/REPL/Script.pm @@ -4,7 +4,6 @@ our $VERSION = '1.003029'; use Moose; use Devel::REPL; -use File::HomeDir; use File::Spec; use Module::Runtime 'use_module'; use namespace::autoclean; @@ -49,7 +48,7 @@ sub load_rcfile { # plain name => ~/.re.pl/${rc_file} if ($rc_file !~ m!/!) { - $rc_file = File::Spec->catfile(File::HomeDir->my_home, '.re.pl', $rc_file); + $rc_file = File::Spec->catfile(($^O eq 'MSWin32' && "$]" < 5.016 ? $ENV{HOME} || $ENV{USERPROFILE} : (<~>)[0]), '.re.pl', $rc_file); } $self->apply_script($rc_file);