line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
1445
|
use 5.008008; |
|
3
|
|
|
|
|
21
|
|
2
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
92
|
|
3
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
171
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Ask::Fallback; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.015'; |
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
16
|
use Moo; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
17
|
|
11
|
3
|
|
|
3
|
|
1107
|
use Carp qw(croak); |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
184
|
|
12
|
3
|
|
|
3
|
|
20
|
use Path::Tiny qw(path); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
170
|
|
13
|
3
|
|
|
3
|
|
21
|
use namespace::autoclean; |
|
3
|
|
|
|
|
18
|
|
|
3
|
|
|
|
|
21
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
with 'Ask::API'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub quality { |
18
|
9
|
|
|
9
|
0
|
105
|
return 1; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub info { |
22
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
23
|
0
|
|
|
|
|
|
print STDERR "$o{text}\n"; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub warning { |
27
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
28
|
0
|
|
|
|
|
|
print STDERR "WARNING: $o{text}\n"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub error { |
32
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
33
|
0
|
|
|
|
|
|
print STDERR "ERROR: $o{text}\n"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub question { |
37
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
38
|
0
|
0
|
|
|
|
|
exists $o{default} and return $o{default}; |
39
|
0
|
|
|
|
|
|
croak "question (Ask::Fallback) with no default"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub entry { |
43
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
44
|
0
|
0
|
|
|
|
|
exists $o{default} and return $o{default}; |
45
|
0
|
|
|
|
|
|
croak "entry (Ask::Fallback) with no default"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub file_selection { |
49
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
50
|
0
|
0
|
0
|
|
|
|
$o{multiple} and exists $o{default} and return map path( $_ ), @{ $o{default} }; |
|
0
|
|
|
|
|
|
|
51
|
0
|
0
|
|
|
|
|
exists $o{default} and return path $o{default}; |
52
|
0
|
|
|
|
|
|
croak "file_selection (Ask::Fallback) with no default"; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub single_choice { |
56
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
57
|
0
|
0
|
|
|
|
|
exists $o{default} and return $o{default}; |
58
|
0
|
|
|
|
|
|
croak "single_choice (Ask::Fallback) with no default"; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub multiple_choice { |
62
|
0
|
|
|
0
|
0
|
|
my ( $self, %o ) = @_; |
63
|
0
|
0
|
|
|
|
|
exists $o{default} and return @{ $o{default} }; |
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
croak "multiple_choice (Ask::Fallback) with no default"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__END__ |