]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/figlet.rb
seen: show what user said or did before leaving
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / figlet.rb
index 64be496c683ecc17de52cc7b2e0ec3f05cf1f283..0eebc813de12da8481785f8716fe0f74d957b1a8 100644 (file)
@@ -122,10 +122,16 @@ class FigletPlugin < Plugin
     exec_params = [send(:"#{key}_path")] + @params[key] + [message]
 
     # run the program
-    m.reply Utils.safe_exec(*exec_params), :max_lines => 0
+    m.reply strip_first_last_empty_line(Utils.safe_exec(*exec_params)), :max_lines => 0
   end
   alias :toilet :figlet
 
+  private
+
+  def strip_first_last_empty_line(txt)
+    txt.gsub(/\A(?:^\s*\r?\n)+/m,'').rstrip
+  end
+
 end
 
 plugin = FigletPlugin.new