line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::RunDoc; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
89261
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
145
|
|
4
|
3
|
|
|
3
|
|
3026
|
use autodie; |
|
3
|
|
|
|
|
60737
|
|
|
3
|
|
|
|
|
22
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
BEGIN { |
7
|
3
|
|
|
3
|
|
20835
|
$Acme::RunDoc::AUTHORITY = 'cpan:TOBYINK'; |
8
|
3
|
|
|
|
|
97
|
$Acme::RunDoc::VERSION = '0.002'; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# 'undef' is Text::Extract::Word's default filter, and probably the only |
12
|
|
|
|
|
|
|
# one that makes sense. |
13
|
3
|
|
|
3
|
|
35
|
use constant FILTER => undef; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
184
|
|
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
18
|
use Carp qw//; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
79
|
|
16
|
3
|
|
|
3
|
|
11424
|
use Data::Dumper qw//; |
|
3
|
|
|
|
|
35787
|
|
|
3
|
|
|
|
|
81
|
|
17
|
3
|
|
|
3
|
|
36
|
use File::Spec; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
100
|
|
18
|
3
|
|
|
3
|
|
2671
|
use IO::File; |
|
3
|
|
|
|
|
34805
|
|
|
3
|
|
|
|
|
496
|
|
19
|
3
|
|
|
3
|
|
3531
|
use Text::Extract::Word; |
|
3
|
|
|
|
|
198534
|
|
|
3
|
|
|
|
|
214
|
|
20
|
3
|
|
|
3
|
|
9690
|
use Module::Runtime qw//; |
|
3
|
|
|
|
|
6260
|
|
|
3
|
|
|
|
|
2438
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub do |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
2
|
1
|
34
|
my ($class, $file) = _args(@_); |
25
|
|
|
|
|
|
|
my $text = Text::Extract::Word->new($file)->get_body(FILTER) |
26
|
2
|
50
|
|
|
|
25
|
or CORE::do { $! = 'cannot read file'; return undef }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
27
|
2
|
|
|
1
|
|
39875
|
return CORE::eval($text); |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
69
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub require_file |
31
|
|
|
|
|
|
|
{ |
32
|
1
|
|
|
1
|
1
|
4
|
my ($class, $file) = _args(@_); |
33
|
1
|
50
|
|
|
|
11
|
my $fh = IO::File->new($file, 'r') |
34
|
|
|
|
|
|
|
or Carp::croak("Could not require file $file: $!"); |
35
|
1
|
50
|
|
|
|
112
|
$class->do($fh) or Carp::croak("Could not require file $file: $@"); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub require |
39
|
|
|
|
|
|
|
{ |
40
|
1
|
|
|
1
|
1
|
3
|
my ($class, $module) = _args(@_); |
41
|
1
|
|
|
|
|
6
|
(my $filename = Module::Runtime::module_notional_filename($module)) |
42
|
1
|
|
|
|
|
57
|
=~ s{ \.pm $ }{ '.docm' }ex; |
43
|
10
|
|
|
|
|
223
|
my ($file) = |
44
|
10
|
|
|
|
|
79
|
grep { -e $_ } |
45
|
1
|
|
|
|
|
4
|
map { File::Spec->catfile($_, $filename) } |
46
|
|
|
|
|
|
|
@INC; |
47
|
1
|
50
|
|
|
|
7
|
Carp::croak("Could not find $filename in \@INC: ".join q{ }, @INC) |
48
|
|
|
|
|
|
|
unless defined $file; |
49
|
1
|
|
|
|
|
5
|
$class->require_file($file); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub use |
53
|
|
|
|
|
|
|
{ |
54
|
1
|
|
|
1
|
1
|
16
|
my ($class, $module, @args) = _args(@_); |
55
|
1
|
|
|
|
|
5
|
$class->require($module); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
{ |
58
|
1
|
|
|
|
|
4
|
my $import = $module->can('import'); |
|
1
|
|
|
|
|
15
|
|
59
|
1
|
|
|
|
|
26
|
@_ = ($module, @args); |
60
|
1
|
50
|
|
|
|
8
|
goto $import if $import; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub import |
65
|
|
|
|
|
|
|
{ |
66
|
3
|
|
|
3
|
|
34
|
my ($class, @args) = _args(@_); |
67
|
3
|
|
|
|
|
12
|
my $caller = scalar caller; |
68
|
3
|
|
|
|
|
7
|
local $Data::Dumper::Indent = 0; |
69
|
3
|
|
|
|
|
2020
|
while (@args) |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
|
|
0
|
my $module = shift @args; |
72
|
0
|
0
|
|
|
|
0
|
my $args = ref $args[0] ? shift @args : undef; |
73
|
0
|
0
|
|
|
|
0
|
my $eval = sprintf( |
|
|
0
|
|
|
|
|
|
74
|
|
|
|
|
|
|
"{ package %s; my \@args = %s; Acme::RunDoc->use('%s', \@args); }", |
75
|
|
|
|
|
|
|
$caller, |
76
|
|
|
|
|
|
|
ref $args eq 'HASH' |
77
|
|
|
|
|
|
|
? sprintf('do { my %s; %%$VAR1 }', Data::Dumper::Dumper($args)) |
78
|
|
|
|
|
|
|
: ref $args |
79
|
|
|
|
|
|
|
? sprintf('do { my %s; @$VAR1 }', Data::Dumper::Dumper($args)) |
80
|
|
|
|
|
|
|
: '()', |
81
|
|
|
|
|
|
|
$module, |
82
|
|
|
|
|
|
|
); |
83
|
0
|
0
|
|
|
|
0
|
eval "$eval; 1" or Carp::croak($@); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub _args |
88
|
|
|
|
|
|
|
{ |
89
|
8
|
|
|
8
|
|
19
|
my (@args) = @_; |
90
|
8
|
50
|
|
|
|
46
|
return @args if $args[0] eq __PACKAGE__; |
91
|
0
|
0
|
0
|
|
|
0
|
return @args if UNIVERSAL::can($args[0] => 'isa') |
92
|
|
|
|
|
|
|
&& $args[0]->isa(__PACKAGE__); |
93
|
0
|
|
|
|
|
0
|
unshift @args, __PACKAGE__; |
94
|
0
|
|
|
|
|
0
|
return @args; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__FILE__ |
98
|
|
|
|
|
|
|
__END__ |