]> git.cworth.org Git - sup/commitdiff
use read instead of readlines.join
authorNicolas Pouillard <nicolas.pouillard@gmail.com>
Fri, 4 Apr 2008 16:00:56 +0000 (18:00 +0200)
committerWilliam Morgan <w@shiny.(none)>
Tue, 22 Apr 2008 23:23:02 +0000 (16:23 -0700)
lib/sup/draft.rb
lib/sup/hook.rb
lib/sup/maildir.rb
lib/sup/modes/file-browser-mode.rb

index 81c00445f764278ae5e298862c7ca9d567bcce2b..21de1513a18a71330a8a3ce0679de68e69f86b8c 100644 (file)
@@ -106,7 +106,7 @@ class DraftLoader < Source
   end
 
   def raw_message offset
-    IO.readlines(fn_for_offset(offset)).join
+    IO.read(fn_for_offset(offset))
   end
 
   def start_offset; 0; end
index 74ecfabefc6e69da993b203bbe2e4f717299ce38..94949195d31090b72de33480318d819e081fc02f 100644 (file)
@@ -120,7 +120,7 @@ private
     unless @hooks.member? name
       @hooks[name] =
         begin
-          returning IO.readlines(fn_for(name)).join do
+          returning IO.read(fn_for(name)) do
             log "read '#{name}' from #{fn_for(name)}"
           end
         rescue SystemCallError => e
index 584e657793ed2b66779c6ccf62ac7f2188de0943..620e8e2ad51ad6fe45f975237de13a3d2a95cc97 100644 (file)
@@ -72,7 +72,7 @@ class Maildir < Source
 
   def raw_message id
     scan_mailbox
-    with_file_for(id) { |f| f.readlines.join }
+    with_file_for(id) { |f| f.read }
   end
 
   def scan_mailbox opts={}
index b49f3f4e8f8a13d8b8f66608627c3b24d29f7a6d..b92468d8921cc631289d5c6b588454a3d278d6ef 100644 (file)
@@ -47,7 +47,7 @@ protected
     return unless f && f.file?
 
     begin
-      BufferManager.spawn f.to_s, TextMode.new(f.readlines.join)
+      BufferManager.spawn f.to_s, TextMode.new(f.read)
     rescue SystemCallError => e
       BufferManager.flash e.message
     end