line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
4929
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
78
|
|
2
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
157
|
|
3
|
|
|
|
|
|
|
package Devel::REPL::Plugin::CompletionDriver::Turtles; |
4
|
|
|
|
|
|
|
# ABSTRACT: Complete Turtles-based commands |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.003027'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
14
|
use Devel::REPL::Plugin; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
9
|
2
|
|
|
2
|
|
10705
|
use Devel::REPL::Plugin::Completion; # die early if cannot load |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
10
|
2
|
|
|
2
|
|
11
|
use namespace::autoclean; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
22
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub BEFORE_PLUGIN { |
13
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
14
|
1
|
|
|
|
|
7
|
$self->load_plugin('Completion'); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
around complete => sub { |
18
|
|
|
|
|
|
|
my $orig = shift; |
19
|
|
|
|
|
|
|
my ($self, $text, $document) = @_; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $prefix = $self->default_command_prefix; |
22
|
|
|
|
|
|
|
my $line_re = qr/^($prefix)(\w+)/; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my @orig = $self->$orig($text, $document); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
if ( my ( $pre, $method ) = ( $text =~ $line_re ) ) { |
27
|
|
|
|
|
|
|
my $filter = qr/^\Q$method/; |
28
|
|
|
|
|
|
|
return ( |
29
|
|
|
|
|
|
|
@orig, |
30
|
|
|
|
|
|
|
( |
31
|
|
|
|
|
|
|
map { "$pre$_" } |
32
|
|
|
|
|
|
|
grep { $_ =~ $filter } |
33
|
|
|
|
|
|
|
map { /^expr?_command_(\w+)/ ? $1 : () } |
34
|
|
|
|
|
|
|
map { $_->name } |
35
|
|
|
|
|
|
|
$self->meta->get_all_methods |
36
|
|
|
|
|
|
|
), |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} else { |
39
|
|
|
|
|
|
|
return @orig; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__PACKAGE__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=pod |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=encoding UTF-8 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Devel::REPL::Plugin::CompletionDriver::Turtles - Complete Turtles-based commands |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 VERSION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
version 1.003027 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>). |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
68
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |