X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FTurtles.pm;h=387f20bf4f1890eee84e81ea1473a5308b59d339;hp=0ae8299ae51d93d163661b1b268ee4d6579e9b12;hb=796cd7ec80de14e45ca8221d545aceb7b9bc0b71;hpb=79e70b9ce0a3066a8ad8950e9cb32f6198afd592 diff --git a/lib/Devel/REPL/Plugin/Turtles.pm b/lib/Devel/REPL/Plugin/Turtles.pm index 0ae8299..387f20b 100644 --- a/lib/Devel/REPL/Plugin/Turtles.pm +++ b/lib/Devel/REPL/Plugin/Turtles.pm @@ -1,11 +1,13 @@ +use strict; +use warnings; package Devel::REPL::Plugin::Turtles; -use Devel::REPL::Plugin; - -use Scalar::Util qw(reftype); +# ABSTRACT: Generic command creation using a read hook -use MooseX::AttributeHelpers; +our $VERSION = '1.003027'; -use namespace::clean -except => [ 'meta' ]; +use Devel::REPL::Plugin; +use Scalar::Util qw(reftype); +use namespace::autoclean; has default_command_prefix => ( isa => "RegexpRef", @@ -14,13 +16,13 @@ has default_command_prefix => ( ); has turtles_matchers => ( - metaclass => "Collection::Array", + traits => ['Array'], isa => "ArrayRef[RegexpRef|CodeRef]", is => "rw", lazy => 1, default => sub { my $prefix = shift->default_command_prefix; [qr/^ $prefix (\w+) \s* (.*) /x] }, - provides => { - unshift => "add_turtles_matcher", + handles => { + add_turtles_matcher => 'unshift', }, ); @@ -71,9 +73,7 @@ sub match_turtles { __END__ -=head1 NAME - -Devel::REPL::Plugin::Turtles - Generic command creation using a read hook +=pod =head1 DESCRIPTION @@ -90,4 +90,3 @@ if other uses for that character are needed (e.g., '#' for the shell escape character in the PDL shell. =cut -