Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Remove use of Object tap method
@ 2010-03-02 19:20 Ben Walton
  2010-03-02 22:10 ` rick.tessner
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Walton @ 2010-03-02 19:20 UTC (permalink / raw)
  To: sup-talk; +Cc: Ben Walton

Remove ruby 1.9-ism in buffer.rb.  This keeps things running on older
ruby versions.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 lib/sup/buffer.rb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index 5772bb0..ccbd38f 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -612,7 +612,12 @@ EOS
       tf.deactivate
       draw_screen :sync => false, :status => status, :title => title
     end
-    tf.value.tap { |x| x.force_encoding Encoding::UTF_8 if x && x.respond_to?(:encoding) }
+
+    v = if tf.value && tf.value.respond_to?(:encoding)
+          tf.value.force_encoding Encoding::UTF_8
+        else
+          tf.value
+        end
   end
 
   def ask_getch question, accept=nil
-- 
1.7.0

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-03 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-02 19:20 [sup-talk] [PATCH] Remove use of Object tap method Ben Walton
2010-03-02 22:10 ` rick.tessner
2010-03-02 22:46   ` Ben Walton
2010-03-03 18:12     ` Rich Lane
2010-03-03 18:25       ` Ben Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox