X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FColors.pm;h=66f7d6e5248b2d79055344229a5d782a76e59cc0;hp=17592b84f56d973135e9ad29ac572ed8f825c63b;hb=796cd7ec80de14e45ca8221d545aceb7b9bc0b71;hpb=e22aa835df762f888ec7ff9efb2a599ebe17538e diff --git a/lib/Devel/REPL/Plugin/Colors.pm b/lib/Devel/REPL/Plugin/Colors.pm index 17592b8..66f7d6e 100644 --- a/lib/Devel/REPL/Plugin/Colors.pm +++ b/lib/Devel/REPL/Plugin/Colors.pm @@ -1,8 +1,13 @@ +use strict; +use warnings; package Devel::REPL::Plugin::Colors; +# ABSTRACT: Add color to return values, warnings, and errors -use Moose::Role; +our $VERSION = '1.003027'; + +use Devel::REPL::Plugin; use Term::ANSIColor; -use namespace::clean -except => [ 'meta' ]; +use namespace::autoclean; has normal_color => ( is => 'rw', lazy => 1, @@ -26,6 +31,7 @@ around format_error => sub { around format_result => sub { my $orig = shift; my $self = shift; + no warnings 'uninitialized'; return join "", ( color($self->normal_color), $orig->($self, @_), @@ -60,15 +66,10 @@ around execute => \&_wrap_warn; __END__ -=head1 NAME - -Devel::REPL::Plugin::Colors - add color to return values, warnings, and errors +=pod =head1 SYNOPSIS - #!/usr/bin/perl - - use lib './lib'; use Devel::REPL; my $repl = Devel::REPL->new;