r59441 - in /branches/upstream/libdevel-repl-perl/current: ./ inc/Module/ inc/Module/Install/ lib/Devel/ lib/Devel/REPL/Plugin/ t/
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Tue Jun 15 18:08:57 UTC 2010
Author: carnil-guest
Date: Tue Jun 15 18:06:42 2010
New Revision: 59441
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59441
Log:
[svn-upgrade] new version libdevel-repl-perl (1.003011)
Modified:
branches/upstream/libdevel-repl-perl/current/Changes
branches/upstream/libdevel-repl-perl/current/META.yml
branches/upstream/libdevel-repl-perl/current/README
branches/upstream/libdevel-repl-perl/current/inc/Module/Install.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/AutoInstall.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Base.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Can.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Fetch.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Include.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Makefile.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Metadata.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Scripts.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Win32.pm
branches/upstream/libdevel-repl-perl/current/inc/Module/Install/WriteAll.pm
branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL.pm
branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Completion.pm
branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/FindVariable.pm
branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/History.pm
branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/ReadLineHistory.pm
branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Turtles.pm
branches/upstream/libdevel-repl-perl/current/t/load_core.t
Modified: branches/upstream/libdevel-repl-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/Changes?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/Changes (original)
+++ branches/upstream/libdevel-repl-perl/current/Changes Tue Jun 15 18:06:42 2010
@@ -1,5 +1,12 @@
+1.003011
+ - History plugin now works for Term::ReadLine::Perl
+ - Add ReadLine file completion if no other matches, fixes rt.cpan#58351
+ - Add a bit more description of Turtle plugin to its POD
+ - Fix rt.cpan#43151 where _-> completion had error
+ - Add some missing functionality to t/load_core.t test coverage
+ - Added docs on quoting and history expansion addressing rt.cpan#48459
1.3.10
-- Add exit_repl attribute as a non-signal related way to indicate the REPL should stop running.
+ - Add exit_repl attribute as a non-signal related way to indicate the REPL should stop running.
1.3.9_02
- resolve rt.cpan#45879 by implementing Term::ReadLine::Perl support for ReadLineHistory
- resolve rt.cpan#55491 by skipping Interrupt test for win32
Modified: branches/upstream/libdevel-repl-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/META.yml?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/META.yml (original)
+++ branches/upstream/libdevel-repl-perl/current/META.yml Tue Jun 15 18:06:42 2010
@@ -8,7 +8,7 @@
configure_requires:
ExtUtils::MakeMaker: 6.42
distribution_type: module
-generated_by: 'Module::Install version 0.97'
+generated_by: 'Module::Install version 0.99'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -21,7 +21,6 @@
- t
requires:
B::Concise: 0
- B::Keywords: 0
Data::Dump::Streamer: 0
Data::Dumper::Concise: 0
Devel::Peek: 0
@@ -38,9 +37,8 @@
Task::Weaken: 0
Term::ANSIColor: 0
Term::ReadLine: 0
- Test::More: 0
namespace::clean: 0
perl: 5.8.1
resources:
license: http://dev.perl.org/licenses/
-version: 1.003010
+version: 1.003011
Modified: branches/upstream/libdevel-repl-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/README?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/README (original)
+++ branches/upstream/libdevel-repl-perl/current/README Tue Jun 15 18:06:42 2010
@@ -32,8 +32,8 @@
1
$_ nosuchfunction
Compile error: Bareword "nosuchfunction" not allowed while "strict subs" in use at (eval 130) line 5.
-
- $_
+
+ $_
In the first example above you see the output of the command ("Hello,
world!"), if any, and then the return value of the statement (1).
@@ -61,16 +61,19 @@
(Do you need to predeclare carp?)
Compile error: syntax error at (eval 129) line 5, near "carp "I'm dieeeing!\n""
BEGIN not safe after errors--compilation aborted at (eval 129) line 5.
-
- $_ use Carp
-
- $_ carp "I'm dieeeing!\n"
+
+ $_ use Carp
+
+ $_ carp "I'm dieeeing!\n"
I'm dieeeing!
at /usr/share/perl5/Lexical/Persistence.pm line 327
1
$_
- To quit from the shell, hit "control+d" or "control+c".
+ To quit from the shell, hit "Ctrl+D" or "Ctrl+C".
+
+ MSWin32 NOTE: control keys won't work if TERM=dumb
+ because readline functionality will be disabled.
Run Control Files
For particular projects you might well end up running the same commands
@@ -152,19 +155,25 @@
In addition to the contents of the standard Perl distribution, you will
need the following:
- * Moose >= 0.64
+ * Moose >= 0.74
* MooseX::Object::Pluggable >= 0.0009
- * MooseX::Getopt >= 0.15
-
- * MooseX::AttributeHelpers >= 0.14
+ * MooseX::Getopt >= 0.18
+
+ * MooseX::AttributeHelpers >= 0.16
* namespace::clean
* File::HomeDir
* Task::Weaken
+
+ * B::Concise
+
+ * Term::ANSIColor
+
+ * Devel::Peek
Optionally, some plugins if installed will require the following
modules:
@@ -173,7 +182,11 @@
* Data::Dump::Streamer
+ * Data::Dumper::Concise
+
* File::Next
+
+ * Sys::SigAction
* B::Keywords
@@ -194,6 +207,10 @@
mgrimes - mgrimes (at) cpan dot org
Shawn M Moore - sartak (at) gmail.com
Oliver Gorwits - oliver on irc.perl.org
+ Andrew Moore - "<amoore at cpan.org>"
+ Norbert Buchmuller "<norbi at nix.hu>"
+ Dave Houston "<dhouston at cpan.org>"
+ Chris Marshall
LICENSE
This library is free software under the same terms as perl itself
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install.pm Tue Jun 15 18:06:42 2010
@@ -22,7 +22,6 @@
use Cwd ();
use File::Find ();
use File::Path ();
-use FindBin;
use vars qw{$VERSION $MAIN};
BEGIN {
@@ -32,7 +31,7 @@
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '0.97';
+ $VERSION = '0.99';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -231,7 +230,12 @@
sub new {
my ($class, %args) = @_;
- FindBin->again;
+ delete $INC{'FindBin.pm'};
+ {
+ # to suppress the redefine warning
+ local $SIG{__WARN__} = sub {};
+ require FindBin;
+ }
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/AutoInstall.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/AutoInstall.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/AutoInstall.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -48,6 +48,14 @@
while (my ($mod, $ver) = splice(@requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
+ my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
+ while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
+ $seen{$mod}{$ver}++;
+ }
+ my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
+ while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
+ $seen{$mod}{$ver}++;
+ }
my @deduped;
while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Base.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Base.pm Tue Jun 15 18:06:42 2010
@@ -4,7 +4,7 @@
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
}
# Suspend handler for "redefined" warnings
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Can.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Can.pm Tue Jun 15 18:06:42 2010
@@ -9,7 +9,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Fetch.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Fetch.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Include.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Include.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Include.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Makefile.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Makefile.pm Tue Jun 15 18:06:42 2010
@@ -4,10 +4,11 @@
use strict 'vars';
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -364,9 +365,9 @@
. ($self->postamble || '');
local *MAKEFILE;
- open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ eval { flock MAKEFILE, LOCK_EX };
my $makefile = do { local $/; <MAKEFILE> };
- close MAKEFILE or die $!;
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
@@ -386,7 +387,8 @@
# XXX - This is currently unused; not sure if it breaks other MM-users
# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
- open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+ seek MAKEFILE, 0, SEEK_SET;
+ truncate MAKEFILE, 0;
print MAKEFILE "$preamble$makefile$postamble" or die $!;
close MAKEFILE or die $!;
@@ -410,4 +412,4 @@
__END__
-#line 539
+#line 541
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Metadata.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Metadata.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -616,8 +616,15 @@
return $v;
}
-
-
+sub add_metadata {
+ my $self = shift;
+ my %hash = @_;
+ for my $key (keys %hash) {
+ warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+ "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+ $self->{values}->{$key} = $hash{$key};
+ }
+}
######################################################################
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Scripts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Scripts.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Scripts.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Scripts.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Win32.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/Win32.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';
+ $VERSION = '0.99';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Modified: branches/upstream/libdevel-repl-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/inc/Module/Install/WriteAll.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/inc/Module/Install/WriteAll.pm Tue Jun 15 18:06:42 2010
@@ -6,7 +6,7 @@
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '0.97';;
+ $VERSION = '0.99';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
Modified: branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL.pm Tue Jun 15 18:06:42 2010
@@ -5,7 +5,7 @@
use namespace::clean -except => [ 'meta' ];
use 5.008001; # backwards compat, doesn't warn like 5.8.1
-our $VERSION = '1.003010';
+our $VERSION = '1.003011';
with 'MooseX::Object::Pluggable';
@@ -223,7 +223,11 @@
1
$_
-To quit from the shell, hit C<control+d> or C<control+c>.
+To quit from the shell, hit C<Ctrl+D> or C<Ctrl+C>.
+
+ MSWin32 NOTE: control keys won't work if TERM=dumb
+ because readline functionality will be disabled.
+
=head2 Run Control Files
@@ -328,7 +332,7 @@
=item *
-L<Moose> >= 0.64
+L<Moose> >= 0.74
=item *
@@ -336,11 +340,11 @@
=item *
-L<MooseX::Getopt> >= 0.15
-
-=item *
-
-L<MooseX::AttributeHelpers> >= 0.14
+L<MooseX::Getopt> >= 0.18
+
+=item *
+
+L<MooseX::AttributeHelpers> >= 0.16
=item *
@@ -354,6 +358,18 @@
L<Task::Weaken>
+=item *
+
+L<B::Concise>
+
+=item *
+
+L<Term::ANSIColor>
+
+=item *
+
+L<Devel::Peek>
+
=back
Optionally, some plugins if installed will require the following modules:
@@ -370,10 +386,18 @@
=item *
+L<Data::Dumper::Concise>
+
+=item *
+
L<File::Next>
=item *
+L<Sys::SigAction>
+
+=item *
+
L<B::Keywords>
=item *
@@ -416,6 +440,8 @@
=item Dave Houston C<< <dhouston at cpan.org> >>
+=item Chris Marshall
+
=back
=head1 LICENSE
Modified: branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Completion.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Completion.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Completion.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Completion.pm Tue Jun 15 18:06:42 2010
@@ -5,96 +5,117 @@
use namespace::clean -except => [ 'meta' ];
has current_matches => (
- is => 'rw',
- isa => 'ArrayRef',
- lazy => 1,
- default => sub { [] },
+ is => 'rw',
+ isa => 'ArrayRef',
+ lazy => 1,
+ default => sub { [] },
);
has match_index => (
- is => 'rw',
- isa => 'Int',
- lazy => 1,
- default => sub { 0 },
+ is => 'rw',
+ isa => 'Int',
+ lazy => 1,
+ default => sub { 0 },
);
has no_term_class_warning => (
- isa => "Bool",
- is => "rw",
- default => 0,
+ isa => "Bool",
+ is => "rw",
+ default => 0,
+);
+
+has do_readline_filename_completion => ( # so default is no if Completion loaded
+ isa => "Bool",
+ is => "rw",
+ lazy => 1,
+ default => sub { 0 },
);
before 'read' => sub {
- my ($self) = @_;
+ my ($self) = @_;
- if ((!$self->term->isa("Term::ReadLine::Gnu") and !$self->term->isa("Term::ReadLine::Perl"))
- and !$self->no_term_class_warning) {
- warn "Term::ReadLine::Gnu or Term::ReadLine::Perl is required for the Completion plugin to work";
- $self->no_term_class_warning(1);
- }
+ if ((!$self->term->isa("Term::ReadLine::Gnu") and !$self->term->isa("Term::ReadLine::Perl"))
+ and !$self->no_term_class_warning) {
+ warn "Term::ReadLine::Gnu or Term::ReadLine::Perl is required for the Completion plugin to work";
+ $self->no_term_class_warning(1);
+ }
- my $weakself = $self;
- weaken($weakself);
+ my $weakself = $self;
+ weaken($weakself);
- $self->term->Attribs->{attempted_completion_function} = sub {
- $weakself->_completion(@_);
- };
+ if ($self->term->isa("Term::ReadLine::Gnu")) {
+ $self->term->Attribs->{attempted_completion_function} = sub {
+ $weakself->_completion(@_);
+ };
+ }
- $self->term->Attribs->{completion_function} = sub {
- $weakself->_completion(@_);
- };
+ if ($self->term->isa("Term::ReadLine::Perl")) {
+ $self->term->Attribs->{completion_function} = sub {
+ $weakself->_completion(@_);
+ };
+ }
+
};
sub _completion {
- my $is_trp = scalar(@_) == 4 ? 1 : 0;
- my ($self, $text, $line, $start, $end) = @_;
- $end = $start+length($text) if $is_trp;
+ my $is_trp = scalar(@_) == 4 ? 1 : 0;
+ my ($self, $text, $line, $start, $end) = @_;
+ $end = $start+length($text) if $is_trp;
- # we're discarding everything after the cursor for completion purposes
- # we can't just use $text because we want all the code before the cursor to
- # matter, not just the current word
- substr($line, $end) = '';
+ # we're discarding everything after the cursor for completion purposes
+ # we can't just use $text because we want all the code before the cursor to
+ # matter, not just the current word
+ substr($line, $end) = '';
- my $document = PPI::Document->new(\$line);
- return unless defined($document);
+ my $document = PPI::Document->new(\$line);
+ return unless defined($document);
- $document->prune('PPI::Token::Whitespace');
+ $document->prune('PPI::Token::Whitespace');
- my @matches = $self->complete($text, $document);
+ my @matches = $self->complete($text, $document);
- # iterate through the completions
- if ($is_trp) {
- return @matches;
- } else {
- return $self->term->completion_matches($text, sub {
- my ($text, $state) = @_;
+ # iterate through the completions
+ if ($is_trp) {
+ if (scalar(@matches)) {
+ return @matches;
+ } else {
+ return ($self->do_readline_filename_completion) ? readline::rl_filename_list($text) : () ;
+ }
+ } else {
+ $self->term->Attribs->{attempted_completion_over} = 1 unless $self->do_readline_filename_completion;
+ if (scalar(@matches)) {
+ return $self->term->completion_matches($text, sub {
+ my ($text, $state) = @_;
- if (!$state) {
- $self->current_matches(\@matches);
- $self->match_index(0);
- }
- else {
- $self->match_index($self->match_index + 1);
- }
+ if (!$state) {
+ $self->current_matches(\@matches);
+ $self->match_index(0);
+ }
+ else {
+ $self->match_index($self->match_index + 1);
+ }
- return $self->current_matches->[$self->match_index];
- });
- }
+ return $self->current_matches->[$self->match_index];
+ });
+ } else {
+ return;
+ }
+ }
}
sub complete {
- return ();
+ return ();
}
# recursively find the last element
sub last_ppi_element {
- my ($self, $document, $type) = @_;
- my $last = $document;
- while ($last->can('last_element') && defined($last->last_element)) {
- $last = $last->last_element;
- return $last if $type && $last->isa($type);
- }
- return $last;
+ my ($self, $document, $type) = @_;
+ my $last = $document;
+ while ($last->can('last_element') && defined($last->last_element)) {
+ $last = $last->last_element;
+ return $last if $type && $last->isa($type);
+ }
+ return $last;
}
1;
@@ -105,6 +126,13 @@
Devel::REPL::Plugin::Completion - Extensible tab completion
+=head1 NOTE
+
+By default, the Completion plugin explicitly does I<not> use the Gnu readline
+or Term::ReadLine::Perl fallback filename completion.
+
+Set the attribute C<do_readline_filename_completion> to 1 to enable this feature.
+
=head1 AUTHOR
Shawn M Moore, C<< <sartak at gmail dot com> >>
Modified: branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/FindVariable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/FindVariable.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/FindVariable.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/FindVariable.pm Tue Jun 15 18:06:42 2010
@@ -23,7 +23,8 @@
my $meta = Class::MOP::Class->initialize($package);
- return unless $meta->has_package_symbol("$sigil$name");
+ # Class::MOP::Package::has_package_symbol method *requires* a sigil
+ return unless length($sigil) and $meta->has_package_symbol("$sigil$name");
$meta->get_package_symbol("$sigil$name");
}
Modified: branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/History.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/History.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/History.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/History.pm Tue Jun 15 18:06:42 2010
@@ -4,49 +4,64 @@
use namespace::clean -except => [ 'meta' ];
has 'history' => (
- isa => 'ArrayRef', is => 'rw', required => 1, lazy => 1,
- default => sub { [] }
+ isa => 'ArrayRef', is => 'rw', required => 1, lazy => 1,
+ default => sub { [] }
+);
+
+# lazy so ReadLineHistory Plugin can set this
+has 'have_readline_history' => (
+ is => 'rw', required => 1, lazy => 1,
+ default => sub { 0 }
);
sub push_history {
- my ($self, $line) = @_;
- push(@{$self->history}, $line);
+ my ($self, $line) = @_;
+ # Push history is not needed if we have Term::ReadLine
+ # support. We put the test inside push_history() in case
+ # someone has modified it in their code.
+ if ($self->have_readline_history) {
+ # update history to keep consistent with Term::ReadLine
+ $self->history( [ $self->term->GetHistory ] );
+ } else {
+ # not used with Term::ReadLine history support
+ push(@{$self->history}, $line);
+ }
}
around 'read' => sub {
- my $orig = shift;
- my ($self, @args) = @_;
- my $line = $self->$orig(@args);
- if (defined $line) {
- if ($line =~ m/^!(.*)$/) {
- my $call = $1;
- $line = $self->history_call($call);
- if (defined $line) {
- $self->print($line."\n");
- } else {
- return "'Unable to find ${call} in history'";
+ my $orig = shift;
+ my ($self, @args) = @_;
+ my $line = $self->$orig(@args);
+ if (defined $line) {
+ if ($line =~ m/^!(.*)$/) {
+ my $call = $1;
+ $line = $self->history_call($call);
+ if (defined $line) {
+ $self->print($line."\n");
+ } else {
+ return "'Unable to find ${call} in history'";
+ }
}
- }
- if ($line =~ m/\S/) {
- $self->push_history($line);
- }
- }
- return $line;
+ if ($line =~ m/\S/) {
+ $self->push_history($line);
+ }
+ }
+ return $line;
};
sub history_call {
- my ($self, $call) = @_;
- if ($call =~ m/^(-?\d+)$/) { # handle !1 or !-1
- my $idx = $1;
- $idx-- if ($idx > 0); # !1 gets history element 0
- my $line = $self->history->[$idx];
- return $line;
- }
- my $re = qr/^\Q${call}\E/;
- foreach my $line (reverse @{$self->history}) {
- return $line if ($line =~ $re);
- }
- return;
+ my ($self, $call) = @_;
+ if ($call =~ m/^(-?\d+)$/) { # handle !1 or !-1
+ my $idx = $1;
+ $idx-- if ($idx > 0); # !1 gets history element 0
+ my $line = $self->history->[$idx];
+ return $line;
+ }
+ my $re = qr/^\Q${call}\E/;
+ foreach my $line (reverse @{$self->history}) {
+ return $line if ($line =~ $re);
+ }
+ return;
};
1;
Modified: branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/ReadLineHistory.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/ReadLineHistory.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/ReadLineHistory.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/ReadLineHistory.pm Tue Jun 15 18:06:42 2010
@@ -39,8 +39,16 @@
close HIST;
}
}
- $self->term->Attribs->{do_expand}=1;
+
+ $self->term->Attribs->{do_expand}=1; # for Term::ReadLine::Gnu
+ $self->term->MinLine(2); # don't save one letter commands
+
+ # let History plugin know we have Term::ReadLine support
+ $self->have_readline_history(1) if $self->can('have_readline_history');
+
+
$self->$orig(@args);
+
if ($self->term->ReadLine eq 'Term::ReadLine::Gnu') {
$self->term->WriteHistory($hist_file) ||
$self->print("warning: failed to write history file $hist_file");
@@ -64,5 +72,39 @@
Devel::REPL::Plugin::ReadLineHistory - Integrate history with the facilities provided by L<Term::ReadLine>
+=head1 DESCRIPTION
+
+This plugin enables loading and saving command line history from
+a file as well has history expansion of previous commands using
+the !-syntax a la bash.
+
+By default, history expansion is enabled with this plugin when
+using L<Term::ReadLine::Gnu|Term::ReadLine::Gnu>. That means that
+"loose" '!' characters will be treated as history events which
+may not be what you wish.
+
+To avoid this, you need to quote the '!' with '\':
+
+ my $var = "foo\!";
+
+or place the arguments in single quotes---but enable the
+C<Term::ReadLine> attribute C<history_quotes_inhibit_expansion>:
+
+ $_REPL->term->Attribs->{history_quotes_inhibit_expansion} = 1;
+ my $var = 'foo!';
+
+and to disable history expansion from GNU readline/history do
+
+ $_REPL->term->Attribs->{do_expand} = 0;
+
+=head1 CONFLICTS
+
+Note that Term::ReadLine::Perl does not support a history
+expansion method. In that case, you may wish to use the
+Devel::REPL History plugin which provides similar functions.
+Work is underway to make use of either History or
+ReadLineHistory consistent for expansion with either the
+Term::ReadLine::Gnu support or Term::ReadLine::Perl.
+
=cut
Modified: branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Turtles.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Turtles.pm?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Turtles.pm (original)
+++ branches/upstream/libdevel-repl-perl/current/lib/Devel/REPL/Plugin/Turtles.pm Tue Jun 15 18:06:42 2010
@@ -75,5 +75,19 @@
Devel::REPL::Plugin::Turtles - Generic command creation using a read hook
+=head1 DESCRIPTION
+
+By default, this plugin allows calling commands using a read hook
+to detect a default_command_prefix followed by the command name,
+say MYCMD as an example. The actual routine to call for the
+command is constructed by looking for subs named 'command_MYCMD'
+or 'expr_MYCMD' and executing them.
+
+=head2 NOTE
+
+The C<default_command_prefix> is C<qr/\#/> so care must be taken
+if other uses for that character are needed (e.g., '#' for the
+shell escape character in the PDL shell.
+
=cut
Modified: branches/upstream/libdevel-repl-perl/current/t/load_core.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-repl-perl/current/t/load_core.t?rev=59441&op=diff
==============================================================================
--- branches/upstream/libdevel-repl-perl/current/t/load_core.t (original)
+++ branches/upstream/libdevel-repl-perl/current/t/load_core.t Tue Jun 15 18:06:42 2010
@@ -6,18 +6,78 @@
use_ok('Devel::REPL::Script');
use_ok('Devel::REPL::Plugin::Colors');
use_ok('Devel::REPL::Plugin::Commands');
+
+eval 'use PPI';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::Completion');
+}
+
+eval 'use File::Next';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::CompletionDriver::INC');
+}
+
+eval 'use B::Keywords';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::CompletionDriver::Keywords');
+}
+
+eval 'use Lexical::Persistence';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::CompletionDriver::LexEnv');
+}
+
+use_ok('Devel::REPL::Plugin::CompletionDriver::Globals');
+use_ok('Devel::REPL::Plugin::CompletionDriver::Methods');
+
+eval 'use Data::Dump::Concise';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::DDC');
+}
+
+eval 'use Data::Dump::Streamer';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::DDS');
+}
+
use_ok('Devel::REPL::Plugin::DumpHistory');
use_ok('Devel::REPL::Plugin::FancyPrompt');
use_ok('Devel::REPL::Plugin::FindVariable');
use_ok('Devel::REPL::Plugin::History');
-# Interrupt depends on Sys::SigAction which
-# is not available on win32 so we skip the
-# test there
-use_ok('Devel::REPL::Plugin::Interrupt') unless $^O eq 'MSWin32';
+
+eval 'use Sys::SigAction';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::Interrupt');
+}
+
+# use_ok('Devel::REPL::Plugin::Interrupt') unless $^O eq 'MSWin32';
+use_ok('Devel::REPL::Plugin::LexEnv');
+
+eval 'use PPI';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::MultiLine::PPI');
+}
+
+eval 'use App::Nopaste';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::Nopaste');
+}
+
use_ok('Devel::REPL::Plugin::OutputCache');
use_ok('Devel::REPL::Plugin::Packages');
use_ok('Devel::REPL::Plugin::Peek');
+eval 'use PPI';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::PPI');
+}
+
use_ok('Devel::REPL::Plugin::ReadLineHistory');
+
+eval 'use Module::Refresh';
+unless ($@) {
+ use_ok('Devel::REPL::Plugin::Refresh');
+}
+
use_ok('Devel::REPL::Plugin::ShowClass');
use_ok('Devel::REPL::Plugin::Timing');
use_ok('Devel::REPL::Plugin::Turtles');
More information about the Pkg-perl-cvs-commits
mailing list