.lib/perl5/ReplyStartup.pm

Thu, 08 Mar 2018 16:16:57 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 08 Mar 2018 16:16:57 -0500
changeset 697
4fdde5f56193
parent 693
ef18d50728ef
permissions
-rw-r--r--

+x

683
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 package ReplyStartup;
691
5e08af1add1e Let's use Import::Base
Meredith Howard <mhoward@roomag.org>
parents: 690
diff changeset
2 use warnings;
5e08af1add1e Let's use Import::Base
Meredith Howard <mhoward@roomag.org>
parents: 690
diff changeset
3 use strict;
5e08af1add1e Let's use Import::Base
Meredith Howard <mhoward@roomag.org>
parents: 690
diff changeset
4
692
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
5 use Import::Into;
683
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 sub import {
691
5e08af1add1e Let's use Import::Base
Meredith Howard <mhoward@roomag.org>
parents: 690
diff changeset
8 my $caller = caller(0);
683
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9
692
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
10 import::into($_ => $caller) for qw(
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
11 strict
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
12 warnings
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
13 experimentals
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
14 Path::Tiny
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
15 );
693
ef18d50728ef make data-printer config private to Reply
Meredith Howard <mhoward@roomag.org>
parents: 692
diff changeset
16 import::into(feature => $caller, ':5.14');
ef18d50728ef make data-printer config private to Reply
Meredith Howard <mhoward@roomag.org>
parents: 692
diff changeset
17 import::into('Data::Printer' => $caller, {
ef18d50728ef make data-printer config private to Reply
Meredith Howard <mhoward@roomag.org>
parents: 692
diff changeset
18 filters => {-external => ['JSON', 'URI']},
ef18d50728ef make data-printer config private to Reply
Meredith Howard <mhoward@roomag.org>
parents: 692
diff changeset
19 class => {show_methods => 'public', inherited => 'public'},
ef18d50728ef make data-printer config private to Reply
Meredith Howard <mhoward@roomag.org>
parents: 692
diff changeset
20 });
692
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
21
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
22 # Run anything in .replyrc.local.pl in the context of
4573c0ed4d0d Actually just Import::Into
Meredith Howard <mhoward@roomag.org>
parents: 691
diff changeset
23 # main, at compile time.
691
5e08af1add1e Let's use Import::Base
Meredith Howard <mhoward@roomag.org>
parents: 690
diff changeset
24 eval(<<END_PERL)->();
5e08af1add1e Let's use Import::Base
Meredith Howard <mhoward@roomag.org>
parents: 690
diff changeset
25 package $caller; sub {
690
d005acd0e883 also portability improvements
Meredith Howard <mhoward@roomag.org>
parents: 683
diff changeset
26 -e \$_ && do(\$_) for glob('~/.replyrc.local.pl');
683
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
27 die \$@ if \$@;
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
28 }
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
29 END_PERL
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30 }
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
31
ea343e7d3abc move reply startup
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
32 1;

mercurial