.replyrc.pl

Mon, 10 Aug 2020 17:51:19 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 10 Aug 2020 17:51:19 -0500
changeset 880
21a8fdcc9f38
parent 703
cce8cf3118c5
child 894
796aae0de126
permissions
-rw-r--r--

Let's opt in to rerere per repo

use lib glob('~/.lib/perl5');

use Data::Printer {
  filters => {-external => ['JSON', 'URI']},
  class   => {show_methods => 'public', inherited => 'public'},
};

use Path::Tiny;


# This is extra awkward bc Data::Printer has no introspection of its config.
# These values need to mirror what's set above, or defaults.
my $ddp_show_private   = 0;
my $ddp_show_inherited = 1;

sub ddp_toggle_private {
  my $val = ($ddp_show_private ^= 1) ? 'all' : 'public';
  Data::Printer->import({class => {show_methods => $val}});
  $val;
}

sub ddp_toggle_inherited {
  my $val = ($ddp_show_inherited ^= 1) ? 'public' : 'none';
  Data::Printer->import({class => {inherited => $val}});
  $val;
}

1;

mercurial