]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/lart.rb
weather plugin: refactor HTML cleanup code
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / lart.rb
index a70c67b858542491ee89417cf524eed180588b85..657537f0ed6644e7bc847b2bb4504a22326dc024 100644 (file)
@@ -139,7 +139,7 @@ class LartPlugin < Plugin
   def handle_listlart(m, params)
     rx = Regexp.new(params[:lart].to_s, true)
     list = @larts.grep(rx)
-    if list
+    unless list.empty?
       m.reply list.join(" | "), :split_at => /\s+\|\s+/
     else
       m.reply "no lart found matching #{params[:lart]}"
@@ -161,7 +161,7 @@ class LartPlugin < Plugin
   def handle_listpraise(m, params)
     rx = Regexp.new(params[:praise].to_s, true)
     list = @praises.grep(rx)
-    if list
+    unless list.empty?
       m.reply list.join(" | "), :split_at => /\s+\|\s+/
     else
       m.reply "no praise found matching #{params[:praise]}"