From a579b7896ddb10c988bfd4c948dc33cad64085c7 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 13 Dec 2015 13:54:16 -0500 Subject: Lotsa changews --- lib/IRC/Client.pm6 | 60 +++++++++++++++++++++++++++++++------- lib/IRC/Client/Plugin.pm6 | 5 ++++ lib/IRC/Client/Plugin/Debugger.pm6 | 8 ++--- lib/IRC/Client/Plugin/PingPong.pm6 | 12 ++------ 4 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 lib/IRC/Client/Plugin.pm6 (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 55d4262..4e95aaf 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -1,8 +1,8 @@ use v6; use IRC::Parser; # parse-irc use IRC::Client::Plugin::PingPong; -role IRC::Client::Plugin { ... } -class IRC::Client:ver<1.001001> { +use IRC::Client::Plugin; +class IRC::Client:ver<1.002001> { has Bool:D $.debug = False; has Str:D $.host = 'localhost'; has Int:D $.port where 0 <= $_ <= 65535 = 6667; @@ -16,6 +16,7 @@ class IRC::Client:ver<1.001001> { has @.plugins-essential = [ IRC::Client::Plugin::PingPong.new ]; + has @!plugs = [|@!plugins-essential, |@!plugins]; method run { await IO::Socket::Async.connect( $!host, $!port ).then({ @@ -24,16 +25,44 @@ class IRC::Client:ver<1.001001> { $.ssay("USER $!username $!userhost $!host :$!userreal\n"); $.ssay("JOIN $_\n") for @!channels; - Supply.interval( .interval ).tap({ $OUTER::_.interval(self) }) - for @!plugins.grep(*.interval); + .register: self for @!plugs.grep(*.^can: 'register'); react { whenever $!sock.Supply -> $str is copy { - $!debug and $str.say; + $!debug and "[server {DateTime.now}] {$str}".put; my $messages = parse-irc $str; - for @$messages -> $message { - .msg(self, $message) - for (@!plugins-essential, @!plugins).flat.grep(*.msg); + MESSAGES: for @$messages -> $message { + $message = False; + $message = {}; + + if ( $message eq 'PRIVMSG' + and $message[0] eq $!nick + ) { + for @!plugs.grep(*.^can: 'privmsg-me') -> $p { + my $res = $p.privmsg-me(self, $message); + next MESSAGES unless $res === irc-not-handled; + } + } + + if ( $message eq 'NOTICE' + and $message[0] eq $!nick + ) { + for @!plugs.grep(*.^can: 'notice-me') -> $p { + my $res = $p.notice-me(self, $message); + 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; + } + + for @!plugs.grep(*.^can: 'msg') -> $p { + my $res = $p.msg(self, $message); + next MESSAGES unless $res === irc-not-handled; + } } } } @@ -44,14 +73,25 @@ class IRC::Client:ver<1.001001> { } method ssay (Str:D $msg) { + $!debug and "{plug-name}$msg".put; $!sock.print("$msg\n"); self; } method privmsg (Str $who, Str $what) { my $msg = ":$!nick!$!username\@$!userhost PRIVMSG $who :$what\n"; - $!debug and say ".privmsg({$msg.subst("\n", "␤", :g)})"; - self.ssay: $msg; + $!debug and "{plug-name}$msg".put; + $!sock.print("$msg\n"); self; } } + +sub plug-name { + my $plug = callframe(3).file; + my $cur = $?FILE; + return '[core] ' if $plug eq $cur; + $cur ~~ s/'.pm6'$//; + $plug ~~ s:g/^ $cur '/' | '.pm6'$//; + $plug ~~ s/'/'/::/; + return "[$plug] "; +} \ No newline at end of file diff --git a/lib/IRC/Client/Plugin.pm6 b/lib/IRC/Client/Plugin.pm6 new file mode 100644 index 0000000..deaef50 --- /dev/null +++ b/lib/IRC/Client/Plugin.pm6 @@ -0,0 +1,5 @@ +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 5966ca0..4c6775c 100644 --- a/lib/IRC/Client/Plugin/Debugger.pm6 +++ b/lib/IRC/Client/Plugin/Debugger.pm6 @@ -1,8 +1,8 @@ -use v6; use Data::Dump; -unit class IRC::Client::Plugin::Debugger:ver<1.001001>; +use IRC::Client::Plugin; +unit class IRC::Client::Plugin::Debugger:ver<1.002001> is IRC::Client::Plugin; -multi method msg () { True } -multi method msg ($irc, $msg) { +method msg ($irc, $msg) { say Dump $msg, :indent(4); + return irc-not-handled; } diff --git a/lib/IRC/Client/Plugin/PingPong.pm6 b/lib/IRC/Client/Plugin/PingPong.pm6 index 7ba977d..a85dc96 100644 --- a/lib/IRC/Client/Plugin/PingPong.pm6 +++ b/lib/IRC/Client/Plugin/PingPong.pm6 @@ -1,10 +1,2 @@ -use v6; -unit class IRC::Client::Plugin::PingPong:ver<1.001001>; - -multi method msg () { True } -multi method msg ($irc, $msg) { - return unless $msg eq 'PING'; - my $res = "PONG {$irc.nick} $msg[0]"; - $irc.debug and say $res; - $irc.ssay($res); -} +unit class IRC::Client::Plugin::PingPong:ver<1.002001>; +method irc-ping ($irc, $msg) { $irc.ssay("PONG {$irc.nick} $msg[0]") } -- cgit v1.1 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(-) (limited to 'lib') 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 From 05647bd1f2312cc756f71152252a6349e86f43c5 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 13 Dec 2015 19:14:23 -0500 Subject: update docs --- lib/IRC/Client.pm6 | 34 +++++++++++++++++----------------- lib/IRC/Client/Plugin.pm6 | 1 - lib/IRC/Client/Plugin/Debugger.pm6 | 4 ++-- lib/IRC/Client/Plugin/PingPong.pm6 | 2 +- 4 files changed, 20 insertions(+), 21 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index c8e6ac4..2623dc2 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -30,37 +30,37 @@ class IRC::Client:ver<1.002001> { react { whenever $!sock.Supply -> $str is copy { $!debug and "[server {DateTime.now}] {$str}".put; - my $messages = parse-irc $str; - MESSAGES: for @$messages -> $message { - $message = {}; + my $event = parse-irc $str; + EVENTS: for @$events -> $e { + $e = {}; - if ( $message eq 'PRIVMSG' - and $message[0] eq $!nick + if ( $e eq 'PRIVMSG' + and $e[0] eq $!nick ) { for @!plugs.grep(*.^can: 'privmsg-me') -> $p { - my $res = $p.privmsg-me(self, $message); - next MESSAGES unless $res === IRC_NOT_HANDLED; + my $res = $p.privmsg-me(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; } } - if ( $message eq 'NOTICE' - and $message[0] eq $!nick + if ( $e eq 'NOTICE' + and $e[0] eq $!nick ) { for @!plugs.grep(*.^can: 'notice-me') -> $p { - my $res = $p.notice-me(self, $message); - next MESSAGES unless $res === IRC_NOT_HANDLED; + my $res = $p.notice-me(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; } } - my $cmd = 'irc-' ~ $message.lc; + my $cmd = 'irc-' ~ $e.lc; for @!plugs.grep(*.^can: $cmd) -> $p { - my $res = $p."$cmd"(self, $message); - next MESSAGES unless $res === IRC_NOT_HANDLED; + my $res = $p."$cmd"(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; } - for @!plugs.grep(*.^can: 'msg') -> $p { - my $res = $p.msg(self, $message); - next MESSAGES unless $res === IRC_NOT_HANDLED; + for @!plugs.grep(*.^can: 'all-events') -> $p { + my $res = $p.all-events(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; } } } diff --git a/lib/IRC/Client/Plugin.pm6 b/lib/IRC/Client/Plugin.pm6 index eda7a0a..55db82c 100644 --- a/lib/IRC/Client/Plugin.pm6 +++ b/lib/IRC/Client/Plugin.pm6 @@ -1,5 +1,4 @@ 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 4ded968..17cf697 100644 --- a/lib/IRC/Client/Plugin/Debugger.pm6 +++ b/lib/IRC/Client/Plugin/Debugger.pm6 @@ -2,7 +2,7 @@ use Data::Dump; use IRC::Client::Plugin; unit class IRC::Client::Plugin::Debugger:ver<1.002001> is IRC::Client::Plugin; -method msg ($irc, $msg) { - say Dump $msg, :indent(4); +method all-events ($irc, $e) { + say Dump $e, :indent(4); return IRC_NOT_HANDLED; } diff --git a/lib/IRC/Client/Plugin/PingPong.pm6 b/lib/IRC/Client/Plugin/PingPong.pm6 index a85dc96..d6b8f28 100644 --- a/lib/IRC/Client/Plugin/PingPong.pm6 +++ b/lib/IRC/Client/Plugin/PingPong.pm6 @@ -1,2 +1,2 @@ unit class IRC::Client::Plugin::PingPong:ver<1.002001>; -method irc-ping ($irc, $msg) { $irc.ssay("PONG {$irc.nick} $msg[0]") } +method irc-ping ($irc, $e) { $irc.ssay("PONG {$irc.nick} $e[0]") } -- cgit v1.1 From cdadd4d23b894d1f8b6e93094e2662332a9ae710 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 13 Dec 2015 20:07:47 -0500 Subject: fix error --- lib/IRC/Client.pm6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 2623dc2..fe6d962 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -30,7 +30,7 @@ class IRC::Client:ver<1.002001> { react { whenever $!sock.Supply -> $str is copy { $!debug and "[server {DateTime.now}] {$str}".put; - my $event = parse-irc $str; + my $events = parse-irc $str; EVENTS: for @$events -> $e { $e = {}; -- cgit v1.1 From c7e225793004a36b8af7d6a58986df31fdb60822 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 21 Dec 2015 08:43:04 -0500 Subject: Add `unhandled` event --- lib/IRC/Client.pm6 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index fe6d962..7b1c7e5 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -52,14 +52,19 @@ class IRC::Client:ver<1.002001> { } } + for @!plugs.grep(*.^can: 'all-events') -> $p { + my $res = $p.all-events(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; + } + my $cmd = 'irc-' ~ $e.lc; for @!plugs.grep(*.^can: $cmd) -> $p { my $res = $p."$cmd"(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } - for @!plugs.grep(*.^can: 'all-events') -> $p { - my $res = $p.all-events(self, $e); + for @!plugs.grep(*.^can: 'unhandled') -> $p { + my $res = $p.unhandled(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } } @@ -93,4 +98,4 @@ sub plug-name { $plug ~~ s:g/^ $cur '/' | '.pm6'$//; $plug ~~ s/'/'/::/; return "[$plug] "; -} \ No newline at end of file +} -- cgit v1.1 From c97eb34b64788602713fcc77d3c18ab17b629318 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 21 Dec 2015 09:10:03 -0500 Subject: Some docs --- lib/IRC/Client.pm6 | 16 ++++++++-------- lib/IRC/Client/Plugin/Debugger.pm6 | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 7b1c7e5..c781ef1 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -34,10 +34,15 @@ class IRC::Client:ver<1.002001> { EVENTS: for @$events -> $e { $e = {}; + for @!plugs.grep(*.^can: 'irc-all-events') -> $p { + my $res = $p.all-events(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; + } + if ( $e eq 'PRIVMSG' and $e[0] eq $!nick ) { - for @!plugs.grep(*.^can: 'privmsg-me') -> $p { + for @!plugs.grep(*.^can: 'irc-privmsg-me') -> $p { my $res = $p.privmsg-me(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } @@ -46,24 +51,19 @@ class IRC::Client:ver<1.002001> { if ( $e eq 'NOTICE' and $e[0] eq $!nick ) { - for @!plugs.grep(*.^can: 'notice-me') -> $p { + for @!plugs.grep(*.^can: 'irc-notice-me') -> $p { my $res = $p.notice-me(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } } - for @!plugs.grep(*.^can: 'all-events') -> $p { - my $res = $p.all-events(self, $e); - next EVENTS unless $res === IRC_NOT_HANDLED; - } - my $cmd = 'irc-' ~ $e.lc; for @!plugs.grep(*.^can: $cmd) -> $p { my $res = $p."$cmd"(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } - for @!plugs.grep(*.^can: 'unhandled') -> $p { + for @!plugs.grep(*.^can: 'irc-unhandled') -> $p { my $res = $p.unhandled(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } diff --git a/lib/IRC/Client/Plugin/Debugger.pm6 b/lib/IRC/Client/Plugin/Debugger.pm6 index 17cf697..131bb35 100644 --- a/lib/IRC/Client/Plugin/Debugger.pm6 +++ b/lib/IRC/Client/Plugin/Debugger.pm6 @@ -2,7 +2,7 @@ use Data::Dump; use IRC::Client::Plugin; unit class IRC::Client::Plugin::Debugger:ver<1.002001> is IRC::Client::Plugin; -method all-events ($irc, $e) { +method irc-all-events ($irc, $e) { say Dump $e, :indent(4); return IRC_NOT_HANDLED; } -- cgit v1.1 From 1e3a40a23f5f7bce1e9512b0619b91986f001fa8 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 21 Dec 2015 09:11:45 -0500 Subject: Add missing irc- prefixes to special methods --- lib/IRC/Client.pm6 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index c781ef1..eaffb23 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -35,7 +35,7 @@ class IRC::Client:ver<1.002001> { $e = {}; for @!plugs.grep(*.^can: 'irc-all-events') -> $p { - my $res = $p.all-events(self, $e); + my $res = $p.irc-all-events(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } @@ -43,7 +43,7 @@ class IRC::Client:ver<1.002001> { and $e[0] eq $!nick ) { for @!plugs.grep(*.^can: 'irc-privmsg-me') -> $p { - my $res = $p.privmsg-me(self, $e); + my $res = $p.irc-privmsg-me(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } } @@ -52,7 +52,7 @@ class IRC::Client:ver<1.002001> { and $e[0] eq $!nick ) { for @!plugs.grep(*.^can: 'irc-notice-me') -> $p { - my $res = $p.notice-me(self, $e); + my $res = $p.irc-notice-me(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } } @@ -64,7 +64,7 @@ class IRC::Client:ver<1.002001> { } for @!plugs.grep(*.^can: 'irc-unhandled') -> $p { - my $res = $p.unhandled(self, $e); + my $res = $p.irc-unhandled(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } } -- cgit v1.1 From c3ac49e463440b318fa70cfddaed3f91c6797556 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 21 Dec 2015 09:43:30 -0500 Subject: Add irc-start-up and irc-connected methods. Toss irc-register --- lib/IRC/Client.pm6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index eaffb23..59efa97 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -19,13 +19,15 @@ class IRC::Client:ver<1.002001> { has @!plugs = [|@!plugins-essential, |@!plugins]; method run { + .irc-start-up: self for @!plugs.grep(*.^can: 'irc-start-up'); + await IO::Socket::Async.connect( $!host, $!port ).then({ $!sock = .result; $.ssay("NICK $!nick\n"); $.ssay("USER $!username $!userhost $!host :$!userreal\n"); $.ssay("JOIN $_\n") for @!channels; - .register: self for @!plugs.grep(*.^can: 'register'); + .irc-connected: self for @!plugs.grep(*.^can: 'irc-connected'); react { whenever $!sock.Supply -> $str is copy { -- cgit v1.1 From c525790efcc8f1b45c3d236a08da1f8ed122fc9b Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 21 Dec 2015 09:56:38 -0500 Subject: Bump versions --- lib/IRC/Client.pm6 | 2 +- lib/IRC/Client/Plugin.pm6 | 3 +-- lib/IRC/Client/Plugin/Debugger.pm6 | 2 +- lib/IRC/Client/Plugin/PingPong.pm6 | 2 +- lib/IRC/Grammar.pm6 | 2 +- lib/IRC/Grammar/Actions.pm6 | 2 +- lib/IRC/Parser.pm6 | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 59efa97..65f80e7 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -2,7 +2,7 @@ use v6; use IRC::Parser; # parse-irc use IRC::Client::Plugin::PingPong; use IRC::Client::Plugin; -class IRC::Client:ver<1.002001> { +class IRC::Client:ver<2.001001> { has Bool:D $.debug = False; has Str:D $.host = 'localhost'; has Int:D $.port where 0 <= $_ <= 65535 = 6667; diff --git a/lib/IRC/Client/Plugin.pm6 b/lib/IRC/Client/Plugin.pm6 index 55db82c..83703d7 100644 --- a/lib/IRC/Client/Plugin.pm6 +++ b/lib/IRC/Client/Plugin.pm6 @@ -1,4 +1,3 @@ constant IRC_HANDLED = "irc plugin handled \x1"; constant IRC_NOT_HANDLED = "irc plugin not-handled \x2"; -unit class IRC::Client::Plugin:ver<1.002002>; - +unit class IRC::Client::Plugin:ver<2.001001>; diff --git a/lib/IRC/Client/Plugin/Debugger.pm6 b/lib/IRC/Client/Plugin/Debugger.pm6 index 131bb35..c959cc2 100644 --- a/lib/IRC/Client/Plugin/Debugger.pm6 +++ b/lib/IRC/Client/Plugin/Debugger.pm6 @@ -1,6 +1,6 @@ use Data::Dump; use IRC::Client::Plugin; -unit class IRC::Client::Plugin::Debugger:ver<1.002001> is IRC::Client::Plugin; +unit class IRC::Client::Plugin::Debugger:ver<2.001001> is IRC::Client::Plugin; method irc-all-events ($irc, $e) { say Dump $e, :indent(4); diff --git a/lib/IRC/Client/Plugin/PingPong.pm6 b/lib/IRC/Client/Plugin/PingPong.pm6 index d6b8f28..b499051 100644 --- a/lib/IRC/Client/Plugin/PingPong.pm6 +++ b/lib/IRC/Client/Plugin/PingPong.pm6 @@ -1,2 +1,2 @@ -unit class IRC::Client::Plugin::PingPong:ver<1.002001>; +unit class IRC::Client::Plugin::PingPong:ver<2.001001>; method irc-ping ($irc, $e) { $irc.ssay("PONG {$irc.nick} $e[0]") } diff --git a/lib/IRC/Grammar.pm6 b/lib/IRC/Grammar.pm6 index d26a3dc..241c497 100644 --- a/lib/IRC/Grammar.pm6 +++ b/lib/IRC/Grammar.pm6 @@ -1,4 +1,4 @@ -unit grammar IRC::Grammar:ver<1.001001>; +unit grammar IRC::Grammar:ver<2.001001>; token TOP { + } token SPACE { ' '+ } token message { [':' ]? \n } diff --git a/lib/IRC/Grammar/Actions.pm6 b/lib/IRC/Grammar/Actions.pm6 index 74a8f11..469f8f8 100644 --- a/lib/IRC/Grammar/Actions.pm6 +++ b/lib/IRC/Grammar/Actions.pm6 @@ -1,4 +1,4 @@ -unit class IRC::Grammar::Actions:ver<1.001001>; +unit class IRC::Grammar::Actions:ver<2.001001>; method TOP ($/) { $/.make: $>>.made } method message ($/) { my $pref = $/; diff --git a/lib/IRC/Parser.pm6 b/lib/IRC/Parser.pm6 index aa87fa7..77de768 100644 --- a/lib/IRC/Parser.pm6 +++ b/lib/IRC/Parser.pm6 @@ -1,6 +1,6 @@ use IRC::Grammar; use IRC::Grammar::Actions; -unit class IRC::Parser:ver<1.001001>; +unit class IRC::Parser:ver<2.001001>; sub parse-irc (Str:D $input) is export { IRC::Grammar.parse($input, actions => IRC::Grammar::Actions).made // []; -- cgit v1.1