File Coverage

blib/lib/Devel/REPL/Plugin/DDC.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1 2     2   8867 use strict;
  2         5  
  2         63  
2 2     2   9 use warnings;
  2         4  
  2         112  
3             # ABSTRACT: Format results with Data::Dumper::Concise
4              
5             our $VERSION = '1.003029';
6              
7             use Devel::REPL::Plugin;
8 2     2   12 use Data::Dumper::Concise ();
  2         3  
  2         15  
9 2     2   9440 use namespace::autoclean;
  2         7499  
  2         52  
10 2     2   14  
  2         4  
  2         21  
11             around 'format_result' => sub {
12             my $orig = shift;
13             my $self = shift;
14             my $to_dump = (@_ > 1) ? [@_] : $_[0];
15             my $out;
16             if (ref $to_dump) {
17             if (overload::Method($to_dump, '""')) {
18             $out = "$to_dump";
19             } else {
20             $out = Data::Dumper::Concise::Dumper($to_dump);
21             }
22             } else {
23             $out = $to_dump;
24             }
25             $self->$orig($out);
26             };
27              
28             1;
29              
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             Devel::REPL::Plugin::DDC - Format results with Data::Dumper::Concise
38              
39             =head1 VERSION
40              
41             version 1.003029
42              
43             =head1 SYNOPSIS
44              
45             # in your re.pl file:
46             use Devel::REPL;
47             my $repl = Devel::REPL->new;
48             $repl->load_plugin('DDS');
49             $repl->run;
50              
51             # after you run re.pl:
52             $ map $_*2, ( 1,2,3 )
53             [
54             2,
55             4,
56             6
57             ];
58              
59             $
60              
61             =head1 SUPPORT
62              
63             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL>
64             (or L<bug-Devel-REPL@rt.cpan.org|mailto:bug-Devel-REPL@rt.cpan.org>).
65              
66             There is also an irc channel available for users of this distribution, at
67             L<C<#devel> on C<irc.perl.org>|irc://irc.perl.org/#devel-repl>.
68              
69             =head1 AUTHOR
70              
71             Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>)
72              
73             =head1 COPYRIGHT AND LICENCE
74              
75             This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>).
76              
77             This is free software; you can redistribute it and/or modify it under
78             the same terms as the Perl 5 programming language system itself.
79              
80             =cut