Strip trailing whitespace from lines before joining them.
authorTom Hughes <tom@compton.nu>
Tue, 10 Nov 2009 09:13:39 +0000 (09:13 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 10 Nov 2009 09:13:39 +0000 (09:13 +0000)
script/deliver-message

index d3af5ffbaa13d53ed7eff520649d1de6c485d442..39901fdf21a09269d2dd8dbb45c9694b437816c8 100755 (executable)
@@ -24,7 +24,7 @@ mail = Mail.new(STDIN)
 message = Message.new(:sender => from, :recipient => to,
                       :sent_on => Time.now.getutc,
                       :title => mail["Subject"],
-                      :body => mail.body.join("\n"))
+                      :body => mail.body.map { |l| l.rstrip }.join("\n"))
 message.save!
 
 Notifier::deliver_message_notification(message)