line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1512
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
2
|
|
|
|
|
|
|
package Module::Install::Gloom; |
3
|
|
|
|
|
|
|
our $VERSION = '0.25'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
478
|
use Module::Install::Base; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use base 'Module::Install::Base'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHOR_ONLY = 1; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub use_gloom { |
12
|
|
|
|
|
|
|
my $self = shift; |
13
|
|
|
|
|
|
|
my $module = shift |
14
|
|
|
|
|
|
|
or die "use_gloom requires the name of a target module"; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
return unless $self->is_admin; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $gloom_path = $self->admin->find_in_inc('Gloom') or return; |
19
|
|
|
|
|
|
|
open IN, $gloom_path or die "Can't open '$gloom_path' for input"; |
20
|
|
|
|
|
|
|
my $code = do { local $/; }; |
21
|
|
|
|
|
|
|
close IN; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$code =~ s/package Gloom;/package $module;/; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $target = $module; |
26
|
|
|
|
|
|
|
$target =~ s/::/\//g; |
27
|
|
|
|
|
|
|
$target = "lib/$target.pm"; |
28
|
|
|
|
|
|
|
open OUT, '>', $target or die "Can't open '$target' for output"; |
29
|
|
|
|
|
|
|
print OUT $code; |
30
|
|
|
|
|
|
|
close OUT; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |