From: Ben Walton <bwalton@artsci.utoronto.ca>
To: sup-talk@rubyforge.org
Cc: Ben Walton <bwalton@artsci.utoronto.ca>
Subject: [sup-talk] [PATCH] Remove use of Object tap method
Date: Tue, 2 Mar 2010 14:20:51 -0500 [thread overview]
Message-ID: <1267557651-7110-2-git-send-email-bwalton@artsci.utoronto.ca> (raw)
In-Reply-To: <y>
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
next reply other threads:[~2010-03-02 19:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 19:20 Ben Walton [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267557651-7110-2-git-send-email-bwalton@artsci.utoronto.ca \
--to=bwalton@artsci.utoronto.ca \
--cc=sup-talk@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox