X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=modules%2Foverride%2FDevel%2FREPL%2FPlugin%2FPermanentHistory.pm;fp=modules%2Foverride%2FDevel%2FREPL%2FPlugin%2FPermanentHistory.pm;h=0000000000000000000000000000000000000000;hp=3a46b56cf28435c50a20659c8da82a4cd773a93b;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/modules/override/Devel/REPL/Plugin/PermanentHistory.pm b/modules/override/Devel/REPL/Plugin/PermanentHistory.pm deleted file mode 100644 index 3a46b56cf..000000000 --- a/modules/override/Devel/REPL/Plugin/PermanentHistory.pm +++ /dev/null @@ -1,39 +0,0 @@ -package Devel::REPL::Plugin::PermanentHistory; - -use Moose::Role; -use namespace::clean -except => [ 'meta' ]; -use File::Slurp; -use Data::Dumper; - -has 'history_file' => ( is => 'rw' ); - -sub load_history { - my $self = shift; - my $file = shift; - - $self->history_file( $file ); - - return unless $self->history_file && -f $self->history_file; - - my @history = - map { chomp; $_ } - read_file($self->history_file); -# print Dumper(\@history); - $self->history( \@history ); - $self->term->addhistory($_) for @history; -} - -before 'DESTROY' => sub { - my $self = shift; - - return unless $self->history_file; - - write_file $self->history_file, - map { $_, $/ } - grep $_, - grep { !/^quit\b/ } - @{ $self->history }; -}; - -1; -