« blib/lib/ExtUtils/Builder/Planner/Extension.pm
↑ Summary
blib/lib/ExtUtils/Builder/Action/Code.pm »
| 1 | package ExtUtils::Builder::CPAN::Tool; | ||||||||||
| 2 | 2 | $ExtUtils::Builder::CPAN::Tool::VERSION = '0.020'; | |||||||||
| 3 | 2 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | ▶ | use parent 'ExtUtils::Builder::Planner::Extension'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | sub add_methods { | ||||||||
|
Subroutine
add_methods: called CC=2 SCAR=12.6
Pod
undocumented
| |||||||||||
| 10 | 1 | my (undef, $planner, %args) = @_; | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | $planner->add_delegate('config', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 13 | 0 | require ExtUtils::Config; | |||||||||
| 14 | 0 | state $config = ExtUtils::Config->new; | |||||||||
| 15 | 1 | }); | |||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | $planner->add_delegate('meta', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Subroutine
meta: not called CC=1 SCAR=6.9
| |||||||||||
| 18 | 0 | require CPAN::Meta; | |||||||||
| 19 | 0 | state $meta = CPAN::Meta->load_file('META.json'); | |||||||||
| 20 | 1 | }); | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | $planner->add_delegate('distribution', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 23 | 0 | return $_[0]->meta->name; | |||||||||
| 24 | 1 | }); | |||||||||
| 25 | 0 | ▶ | $planner->add_delegate('version', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 26 | 0 | return version->new($_[0]->meta->version); | |||||||||
| 27 | 1 | }); | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | $planner->add_delegate('main_module', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 30 | 0 | state $main_module = do { | |||||||||
| 31 | 0 | my $distribution = $_[0]->distribution; | |||||||||
| 32 | 0 | $distribution =~ s/-/::/g; | |||||||||
| 33 | 0 | $distribution; | |||||||||
| 34 | }; | ||||||||||
| 35 | 1 | }); | |||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | $planner->add_delegate('perl_path', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 38 | 0 | require ExtUtils::Builder::Util; | |||||||||
| 39 | 0 | state $path = ExtUtils::Builder::Util::get_perl(config => $_[0]->config); | |||||||||
| 40 | 1 | }); | |||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | $planner->add_delegate($_, sub { !!0 }) for qw/verbose uninst pureperl_only/; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 43 | 0 | ▶ | $planner->add_delegate('jobs', sub { 1 }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | $planner->add_delegate('is_os', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 46 | 0 | my ($self, @wanted) = @_; | |||||||||
| 47 | 0 | return not not grep { $_ eq $^O } @wanted | |||||||||
| 48 | 1 | }); | |||||||||
| 49 | 0 | ▶ | $planner->add_delegate('is_os_type', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 50 | 0 | my ($self, $wanted) = @_; | |||||||||
| 51 | 0 | require Perl::OSType; | |||||||||
| 52 | 0 | return Perl::OSType::is_os_type($wanted); | |||||||||
| 53 | 1 | }); | |||||||||
| 54 | |||||||||||
| 55 | 0 | ▶ | $planner->add_delegate('new_planner', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 56 | 0 | my ($self, %options) = @_; | |||||||||
| 57 | 0 | my $config = $self->config; | |||||||||
| 58 | 0 | ▶ | $config = $config->but($options{but}) if $options{but}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | 0 | require ExtUtils::Builder::Planner; | |||||||||
| 60 | 0 | my $inner = ExtUtils::Builder::Planner->new; | |||||||||
| 61 | 0 | ▶ | $inner->add_delegate('config', sub { $config }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 62 | 0 | return $inner; | |||||||||
| 63 | 1 | }); | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 2 | 1; | |||||||||
| 67 | |||||||||||
| 68 | # ABSTRACT: A base implementation for CPAN build scripts. | ||||||||||
| 69 | |||||||||||
| 70 | __END__ | ||||||||||