Thu, 12 Oct 2023 21:32:02 -0400
Fix event key typo
698 | 1 | use lib glob('~/.lib/perl5'); |
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 | 5 | class => {show_methods => 'public', inherited => 'public'}, |
6 | }; | |
7 | ||
8 | use Path::Tiny; | |
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 | 28 | 1; |