From 22e34475c8fe5d6957525962adb4f65d910e46d0 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 13 Dec 2015 14:14:10 -0500 Subject: Rename constants to all-caps --- lib/IRC/Client.pm6 | 9 ++++----- lib/IRC/Client/Plugin.pm6 | 4 ++-- lib/IRC/Client/Plugin/Debugger.pm6 | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 4e95aaf..c8e6ac4 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -32,7 +32,6 @@ class IRC::Client:ver<1.002001> { $!debug and "[server {DateTime.now}] {$str}".put; my $messages = parse-irc $str; MESSAGES: for @$messages -> $message { - $message = False; $message = {}; if ( $message eq 'PRIVMSG' @@ -40,7 +39,7 @@ class IRC::Client:ver<1.002001> { ) { for @!plugs.grep(*.^can: 'privmsg-me') -> $p { my $res = $p.privmsg-me(self, $message); - next MESSAGES unless $res === irc-not-handled; + next MESSAGES unless $res === IRC_NOT_HANDLED; } } @@ -49,19 +48,19 @@ class IRC::Client:ver<1.002001> { ) { for @!plugs.grep(*.^can: 'notice-me') -> $p { my $res = $p.notice-me(self, $message); - next MESSAGES unless $res === irc-not-handled; + next MESSAGES unless $res === IRC_NOT_HANDLED; } } my $cmd = 'irc-' ~ $message.lc; for @!plugs.grep(*.^can: $cmd) -> $p { my $res = $p."$cmd"(self, $message); - next MESSAGES unless $res === irc-not-handled; + next MESSAGES unless $res === IRC_NOT_HANDLED; } for @!plugs.grep(*.^can: 'msg') -> $p { my $res = $p.msg(self, $message); - next MESSAGES unless $res === irc-not-handled; + next MESSAGES unless $res === IRC_NOT_HANDLED; } } } diff --git a/lib/IRC/Client/Plugin.pm6 b/lib/IRC/Client/Plugin.pm6 index deaef50..eda7a0a 100644 --- a/lib/IRC/Client/Plugin.pm6 +++ b/lib/IRC/Client/Plugin.pm6 @@ -1,5 +1,5 @@ -constant irc-handled = "irc plugin handled \x1"; -constant irc-not-handled = "irc plugin not-handled \x2"; +constant IRC_HANDLED = "irc plugin handled \x1"; +constant IRC_NOT_HANDLED = "irc plugin not-handled \x2"; unit class IRC::Client::Plugin:ver<1.002002>; has $.irc; diff --git a/lib/IRC/Client/Plugin/Debugger.pm6 b/lib/IRC/Client/Plugin/Debugger.pm6 index 4c6775c..4ded968 100644 --- a/lib/IRC/Client/Plugin/Debugger.pm6 +++ b/lib/IRC/Client/Plugin/Debugger.pm6 @@ -4,5 +4,5 @@ unit class IRC::Client::Plugin::Debugger:ver<1.002001> is IRC::Client::Plugin; method msg ($irc, $msg) { say Dump $msg, :indent(4); - return irc-not-handled; + return IRC_NOT_HANDLED; } -- cgit v1.1