From 07264216dfb1ba527e5aaced7677483df0dae2df Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Tue, 30 May 2017 19:07:55 -0400 Subject: Fix colorization --- META6.json | 2 +- lib/IRC/Client.pm6 | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/META6.json b/META6.json index b347847..40f461e 100644 --- a/META6.json +++ b/META6.json @@ -2,7 +2,7 @@ "perl" : "6.c", "name" : "IRC::Client", "license" : "Artistic-2.0", - "version" : "3.006004", + "version" : "3.006005", "description" : "Extendable Internet Relay Chat client", "tags" : [ "Net", "IRC" ], "depends" : [ diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index e5696b4..400a326 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -20,17 +20,9 @@ has Lock $!lock = Lock.new; has Channel $!event-pipe = Channel.new; has Channel $!socket-pipe = Channel.new; -my &colored = get-colored; -&colored //= sub (Str $s, $) { $s }; - -sub get-colored { - my &colored; - try { - require Terminal::ANSIColor; - &colored = GLOBAL::Terminal::ANSIColor::EXPORT::DEFAULT::<&colored>; - } - &colored; -} +my &colored = (try require Terminal::ANSIColor) === Nil + && sub (Str $s, $) { $s } || + ::('Terminal::ANSIColor::EXPORT::DEFAULT::&colored'); submethod BUILD ( Int:D :$!debug = 0, -- cgit v1.1