.replyrc.pl

Sun, 19 Feb 2023 11:29:08 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 19 Feb 2023 11:29:08 -0600
changeset 1026
b70ed2db4354
parent 894
796aae0de126
permissions
-rw-r--r--

More option fixes

698
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 use lib glob('~/.lib/perl5');
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2
894
796aae0de126 update for data-printer 1.0
Meredith Howard <mhoward@roomag.org>
parents: 703
diff changeset
3 use Data::Printer 1.0 {
796aae0de126 update for data-printer 1.0
Meredith Howard <mhoward@roomag.org>
parents: 703
diff changeset
4 filters => ['JSON', 'URI'],
698
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 class => {show_methods => 'public', inherited => 'public'},
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 };
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 use Path::Tiny;
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9
703
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
10
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
11 # This is extra awkward bc Data::Printer has no introspection of its config.
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
12 # These values need to mirror what's set above, or defaults.
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
13 my $ddp_show_private = 0;
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
14 my $ddp_show_inherited = 1;
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
15
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
16 sub ddp_toggle_private {
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
17 my $val = ($ddp_show_private ^= 1) ? 'all' : 'public';
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
18 Data::Printer->import({class => {show_methods => $val}});
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
19 $val;
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
20 }
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
21
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
22 sub ddp_toggle_inherited {
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
23 my $val = ($ddp_show_inherited ^= 1) ? 'public' : 'none';
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
24 Data::Printer->import({class => {inherited => $val}});
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
25 $val;
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
26 }
cce8cf3118c5 add ddp config toggles
Meredith Howard <mhoward@roomag.org>
parents: 701
diff changeset
27
698
e5389e9fdb82 less magic
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28 1;

mercurial