X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FCompletionDriver%2FTurtles.pm;h=d34311906924978944a41eca4af0a668fdf9fc8d;hp=3a5913e5b18e2becc9ca5fb589506a5acbcdffa6;hb=HEAD;hpb=30b459d4fbeb6f2406a3013c7cbcc46a6d0ccf0d diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm b/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm index 3a5913e..d343119 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/Turtles.pm @@ -1,12 +1,18 @@ -#!/usr/bin/perl - +use strict; +use warnings; package Devel::REPL::Plugin::CompletionDriver::Turtles; +# ABSTRACT: Complete Turtles-based commands + +our $VERSION = '1.003030'; + 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 +31,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,13 +44,10 @@ __PACKAGE__ __END__ -=head1 NAME - -Devel::REPL::Plugin::CompletionDriver::Turtles - Complete Turtles-based commands +=pod =head1 AUTHOR Yuval Kogman Enothingmuch@woobling.orgE =cut -