From: Giuseppe Bilotta Date: Fri, 21 Sep 2007 19:45:08 +0000 (+0000) Subject: reaction plugin: no more :stuff, but :before and :after for the pre and postmatch... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=9084fa0b0c62988319548157b3a10608c35b2120;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git reaction plugin: no more :stuff, but :before and :after for the pre and postmatch text --- diff --git a/data/rbot/plugins/reaction.rb b/data/rbot/plugins/reaction.rb index ec48caa0..4f757ddd 100644 --- a/data/rbot/plugins/reaction.rb +++ b/data/rbot/plugins/reaction.rb @@ -223,14 +223,16 @@ class ReactionPlugin < Plugin m1.first[0].length <=> m2.first[0].length }.last matched = match[0] - stuff = match.post_match.strip - target, what = stuff.split(/\s+/, 2) + before = match.pre_match.strip + after = match.post_match.strip + target, what = after.split(/\s+/, 2) extra = { :who => m.sourcenick, :match => matched, :target => target, :what => what, - :stuff => stuff + :before => before, + :after => after } match.to_a.each_with_index { |d, i| extra[:"match#{i}"] = d