* [sup-talk] [PATCH] Use read instead of readlines.join.
@ 2008-04-04 16:00 Nicolas Pouillard
2008-04-21 8:02 ` Nicolas Pouillard
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Pouillard @ 2008-04-04 16:00 UTC (permalink / raw)
---
lib/sup/draft.rb | 2 +-
lib/sup/hook.rb | 2 +-
lib/sup/maildir.rb | 2 +-
lib/sup/modes/file-browser-mode.rb | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/draft.rb b/lib/sup/draft.rb
index 81c0044..21de151 100644
--- a/lib/sup/draft.rb
+++ b/lib/sup/draft.rb
@@ -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
diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb
index 74ecfab..9494919 100644
--- a/lib/sup/hook.rb
+++ b/lib/sup/hook.rb
@@ -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
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
index 584e657..620e8e2 100644
--- a/lib/sup/maildir.rb
+++ b/lib/sup/maildir.rb
@@ -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={}
diff --git a/lib/sup/modes/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
index b49f3f4..b92468d 100644
--- a/lib/sup/modes/file-browser-mode.rb
+++ b/lib/sup/modes/file-browser-mode.rb
@@ -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
--
1.5.5.rc3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] [PATCH] Use read instead of readlines.join.
2008-04-04 16:00 [sup-talk] [PATCH] Use read instead of readlines.join Nicolas Pouillard
@ 2008-04-21 8:02 ` Nicolas Pouillard
2008-04-23 1:43 ` William Morgan
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Pouillard @ 2008-04-21 8:02 UTC (permalink / raw)
What about this patch?
Excerpts from Nicolas Pouillard's message of Fri Apr 04 18:00:56 +0200 2008:
> ---
> lib/sup/draft.rb | 2 +-
> lib/sup/hook.rb | 2 +-
> lib/sup/maildir.rb | 2 +-
> lib/sup/modes/file-browser-mode.rb | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/lib/sup/draft.rb b/lib/sup/draft.rb
> index 81c0044..21de151 100644
> --- a/lib/sup/draft.rb
> +++ b/lib/sup/draft.rb
> @@ -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
> diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb
> index 74ecfab..9494919 100644
> --- a/lib/sup/hook.rb
> +++ b/lib/sup/hook.rb
> @@ -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
> diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
> index 584e657..620e8e2 100644
> --- a/lib/sup/maildir.rb
> +++ b/lib/sup/maildir.rb
> @@ -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={}
> diff --git a/lib/sup/modes/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
> index b49f3f4..b92468d 100644
> --- a/lib/sup/modes/file-browser-mode.rb
> +++ b/lib/sup/modes/file-browser-mode.rb
> @@ -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
--
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080421/86548146/attachment.bin
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] [PATCH] Use read instead of readlines.join.
2008-04-21 8:02 ` Nicolas Pouillard
@ 2008-04-23 1:43 ` William Morgan
0 siblings, 0 replies; 3+ messages in thread
From: William Morgan @ 2008-04-23 1:43 UTC (permalink / raw)
Reformatted excerpts from nicolas.pouillard's message of 2008-04-21:
> What about this patch?
Applied directly to master, and sorry for the delay.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-23 1:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-04 16:00 [sup-talk] [PATCH] Use read instead of readlines.join Nicolas Pouillard
2008-04-21 8:02 ` Nicolas Pouillard
2008-04-23 1:43 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox