X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FCompletionDriver%2FTurtles.pm;h=abdd761c176d29d95a867eb676fd4c0c2006a3f8;hb=f109bc790c4450543e3bd07beb3abee5c4b923e0;hp=940bbffe6ae5d972437d64d0abf19c62702f3b62;hpb=203774462f847ecce8af8b115fd370dde4572da0;p=p5sagit%2FDevel-REPL.git diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm index 940bbff..abdd761 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm @@ -1,12 +1,17 @@ -#!/usr/bin/perl - +use strict; +use warnings; package Devel::REPL::Plugin::CompletionDriver::Turtles; + +our $VERSION = '1.003027'; + use Devel::REPL::Plugin; +use Devel::REPL::Plugin::Completion; # die early if cannot load +use namespace::autoclean; -with qw( - Devel::REPL::Plugin::Completion - Devel::REPL::Plugin::Turtles -); +sub BEFORE_PLUGIN { + my $self = shift; + $self->load_plugin('Completion'); +} around complete => sub { my $orig = shift; @@ -25,8 +30,8 @@ around complete => sub { map { "$pre$_" } grep { $_ =~ $filter } map { /^expr?_command_(\w+)/ ? $1 : () } - map { $_->{name} } - $self->meta->compute_all_applicable_methods + map { $_->name } + $self->meta->get_all_methods ), ); } else { @@ -38,4 +43,13 @@ __PACKAGE__ __END__ +=head1 NAME + +Devel::REPL::Plugin::CompletionDriver::Turtles - Complete Turtles-based commands + +=head1 AUTHOR + +Yuval Kogman Enothingmuch@woobling.orgE + +=cut