commit 41e0712333ff391ab4b0ef1b307b1e013e4e20ae
parent 6831c5966aa0a6021978bffc071734d03cabf2b1
Author: Israel Herraiz <israel.herraiz@gmail.com>
Date: Tue, 4 Nov 2008 15:07:21 +0100
wrap text attachments
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
@@ -41,6 +41,8 @@ end
module Redwood
module Chunk
+ WRAP_LEN = 80 # wrap messages and text attachments at this width
+
class Attachment
HookManager.register "mime-decode", <<EOS
Executes when decoding a MIME attachment.
@@ -95,6 +97,7 @@ EOS
@lines = nil
if text
@lines = text.gsub("\r\n", "\n").gsub(/\t/, " ").gsub(/\r/, "").split("\n")
+ @lines = lines.map {|l| l.chomp.wrap WRAP_LEN}.flatten
@quotable = true
end
end
@@ -143,7 +146,6 @@ EOS
end
class Text
- WRAP_LEN = 80 # wrap at this width
attr_reader :lines
def initialize lines