fixed list array

This commit is contained in:
Thomas von Dein
2017-04-04 23:26:57 +02:00
parent 395ac4f678
commit bec7d2b572
3 changed files with 121 additions and 111 deletions

View File

@@ -1,4 +1,9 @@
NEXT
0.06
fixed crash, which happened when one executed the
'list' command if inside an array. now we divert
to 'show' in such a case.
0.05
signal value matches in search with quotes
0.04

View File

@@ -1,8 +1,8 @@
#!/usr/bin/perl
#
# Copyright (c) 2015 T.v.Dein <tlinden |AT| cpan.org>.
# All Rights Reserved. Std. disclaimer applies.
# Artistic License, same as perl itself. Have fun.
# Copyright (c) 2015-2017 T.v.Dein <tlinden |AT| cpan.org>. All
# Rights Reserved. Std. disclaimer applies. Artistic License, same as
# perl itself. Have fun.
#
@@ -21,7 +21,7 @@ no strict 'refs';
use Data::Dumper;
$Data::Interactive::Inspect::VERSION = 0.05;
$Data::Interactive::Inspect::VERSION = 0.06;
use vars qw(@ISA);
@@ -110,7 +110,7 @@ sub new {
if ($self->{transactions}) {
# map if supported
foreach my $c(qw(begin commit rollback)) {
foreach my $c (qw(begin commit rollback)) {
$self->{command}->{$c} = $c;
}
}
@@ -580,8 +580,15 @@ sub edit {
sub list {
my $self = shift;
if (ref($self->{db}) eq 'ARRAY') {
# already implements array listing
$self->show;
}
else {
print join "\n", sort keys %{$self->{db}};
print "\n";
}
return 1;
}
@@ -589,8 +596,6 @@ sub list {
sub show {
my ($self, $indent) = @_;
if (ref($self->{db}) =~ /array/i) {
my $pos = 0;
foreach my $item (@{$self->{db}}) {
@@ -1133,8 +1138,8 @@ http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data::Interactive::Inspect
=head1 COPYRIGHT
Copyright (c) 2015 by T.v.Dein <tlinden@cpan.org>.
All rights reserved.
Copyright (c) 2015-2017 by T.v.Dein <tlinden@cpan.org>. All rights
reserved.
=head1 LICENSE
@@ -1143,6 +1148,6 @@ and/or modify it under the same terms as Perl itself.
=head1 VERSION
This is the manual page for L<Data::Interactive::Inspect> Version 0.05.
This is the manual page for L<Data::Interactive::Inspect> Version 0.06.
=cut

4
README
View File

@@ -44,7 +44,7 @@ BUGS
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data::Interactive::Inspect
COPYRIGHT
Copyright (c) 2015 by T.v.Dein <tlinden@cpan.org>. All rights
Copyright (c) 2015-2017 by T.v.Dein <tlinden@cpan.org>. All rights
reserved.
LICENSE
@@ -52,4 +52,4 @@ LICENSE
under the same terms as Perl itself.
VERSION
This is the manual page for Data::Interactive::Inspect Version 0.01.
This is the manual page for Data::Interactive::Inspect Version 0.06.