line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
370052
|
use 5.008008; |
|
5
|
|
|
|
|
53
|
|
2
|
5
|
|
|
5
|
|
29
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
125
|
|
3
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
340
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Ask; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.013'; |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
36
|
use Carp qw(croak); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
270
|
|
11
|
5
|
|
|
5
|
|
2473
|
use Moo::Role qw(); |
|
5
|
|
|
|
|
77785
|
|
|
5
|
|
|
|
|
152
|
|
12
|
5
|
|
|
5
|
|
40
|
use Module::Runtime qw(use_module use_package_optimistically); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
40
|
|
13
|
|
|
|
|
|
|
use Module::Pluggable ( |
14
|
5
|
|
|
|
|
43
|
search_path => 'Ask', |
15
|
|
|
|
|
|
|
except => [qw/ Ask::API Ask::Functions Ask::Question /], |
16
|
|
|
|
|
|
|
inner => 0, |
17
|
|
|
|
|
|
|
require => 0, |
18
|
|
|
|
|
|
|
sub_name => '__plugins', |
19
|
5
|
|
|
5
|
|
2770
|
); |
|
5
|
|
|
|
|
44436
|
|
20
|
5
|
|
|
5
|
|
2971
|
use namespace::autoclean; |
|
5
|
|
|
|
|
67987
|
|
|
5
|
|
|
|
|
24
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub import { |
23
|
5
|
|
|
5
|
|
44
|
shift; |
24
|
5
|
50
|
|
|
|
3622
|
if ( @_ ) { |
25
|
0
|
|
|
|
|
0
|
require Ask::Functions; |
26
|
0
|
|
|
|
|
0
|
unshift @_, 'Ask::Functions'; |
27
|
0
|
|
|
|
|
0
|
goto( $_[0]->can( 'import' ) ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub plugins { |
32
|
3
|
|
|
3
|
1
|
15
|
__plugins( @_ ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub backends { |
36
|
3
|
|
|
3
|
1
|
9
|
my $class = shift; |
37
|
30
|
|
|
|
|
315
|
sort { $b->quality <=> $a->quality } |
38
|
|
|
|
|
|
|
grep { |
39
|
3
|
|
|
|
|
21
|
eval { use_package_optimistically( $_ )->DOES( 'Ask::API' ) } |
|
30
|
|
|
|
|
19874
|
|
|
30
|
|
|
|
|
98
|
|
40
|
|
|
|
|
|
|
} $class->plugins; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub detect { |
44
|
3
|
|
|
3
|
1
|
290
|
my $class = shift; |
45
|
3
|
50
|
|
|
|
24
|
my %args = @_ == 1 ? %{ $_[0] } : @_; |
|
0
|
|
|
|
|
0
|
|
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
13
|
my @implementations = $class->backends; |
48
|
|
|
|
|
|
|
|
49
|
3
|
50
|
0
|
|
|
19
|
if ( exists $ENV{PERL_ASK_BACKEND} ) { |
|
|
0
|
0
|
|
|
|
|
50
|
3
|
|
|
|
|
17
|
@implementations = use_module( $ENV{PERL_ASK_BACKEND} ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
elsif ( $ENV{AUTOMATED_TESTING} |
53
|
|
|
|
|
|
|
or $ENV{PERL_MM_USE_DEFAULT} |
54
|
|
|
|
|
|
|
or not @implementations ) |
55
|
|
|
|
|
|
|
{ |
56
|
0
|
|
|
|
|
0
|
@implementations = use_module( 'Ask::Fallback' ); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
3
|
100
|
|
|
|
213
|
my @traits = @{ delete( $args{traits} ) || [] }; |
|
3
|
|
|
|
|
28
|
|
60
|
3
|
|
|
|
|
10
|
for my $i ( @implementations ) { |
61
|
3
|
100
|
|
|
|
14
|
my $k = @traits ? "Moo::Role"->create_class_with_roles( $i, @traits ) : $i; |
62
|
3
|
50
|
|
|
|
838
|
my $self = eval { $k->new( { %args, %{ $args{$i} or {} } } ) } or next; |
|
3
|
50
|
|
|
|
13
|
|
|
3
|
|
|
|
|
273
|
|
63
|
3
|
50
|
|
|
|
5795
|
return $self if $self->is_usable; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
0
|
croak "No usable backend for Ask"; |
67
|
|
|
|
|
|
|
} #/ sub detect |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub Q { |
70
|
1
|
|
|
1
|
0
|
10321
|
require Ask::Question; |
71
|
1
|
|
|
|
|
6
|
'Ask::Question'->new( @_ ); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |