« blib/lib/Perl/PrereqScanner/NotQuiteLite/Parser/Mixin.pm
↑ Summary
lib/Perl/PrereqScanner/NotQuiteLite/Parser/Autouse.pm »
| 1 | package Perl::PrereqScanner::NotQuiteLite::Parser::MojoBase; | ||||||||||
| 2 | |||||||||||
| 3 | 88 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 88 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 88 | ▶ | use Perl::PrereqScanner::NotQuiteLite::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 88 | my @MojoBaseLike = qw/ | |||||||||
| 8 | Mojo::Base | ||||||||||
| 9 | Mojo::Weixin::Base Mojo::Webqq::Base | ||||||||||
| 10 | Kelp::Base Rethinkdb::Base PMLTQ::Base | ||||||||||
| 11 | /; | ||||||||||
| 12 | |||||||||||
| 13 | sub register { | ||||||||||
| 14 | 87 | ▶ | my ($class, %args) = @_; | ||||||||
|
Subroutine
register: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 15 | 87 | ▶ | my %mojo_base_like = map {$_ => 1} (@MojoBaseLike, @{$args{mojo_base_like} || []}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 87 | my %mapping; | |||||||||
| 17 | 87 | for my $module (keys %mojo_base_like) { | |||||||||
| 18 | 522 | $mapping{use}{$module} = 'parse_mojo_base_args'; | |||||||||
| 19 | } | ||||||||||
| 20 | 87 | return \%mapping; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | sub parse_mojo_base_args { | ||||||||||
| 24 | 12 | ▶ | my ($class, $c, $used_module, $raw_tokens) = @_; | ||||||||
|
Subroutine
parse_mojo_base_args: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 25 | |||||||||||
| 26 | 12 | my $tokens = convert_string_tokens($raw_tokens); | |||||||||
| 27 | 12 | ▶ | if (is_version($tokens->[0])) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | $c->add($used_module => shift @$tokens); | |||||||||
| 29 | } | ||||||||||
| 30 | 12 | my $module = $tokens->[0]; | |||||||||
| 31 | 12 | ▶ | if (ref $module) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 2 | $module = $module->[0]; | |||||||||
| 33 | } | ||||||||||
| 34 | 12 | ▶ | if (is_module_name($module)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 8 | $module =~ s|'|::|g; | |||||||||
| 36 | 8 | $c->add($module => 0); | |||||||||
| 37 | } | ||||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 88 | 1; | |||||||||
| 41 | |||||||||||
| 42 | __END__ | ||||||||||