From: William Morgan <wmorgan-sup@masanjin.net>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] console gem 0.3
Date: Tue, 18 Jan 2011 15:05:58 -0500 [thread overview]
Message-ID: <1295381104-sup-809@masanjin.net> (raw)
Hi guys,
I've finally released a new version of the console gem which supports
Ruby 1.8. This will be useful in Sup to a) replace String#display_length
(which is a totally wrong hack right now), and b) replace the dl/import
set_locale madness in bin/sup.
So basically this should remove some code and should improve i18n
support for CJK users.
Before I work on a patch, I'm curious if those of you on funny operating
systems (e.g. Cygwin, BSD, Darwin) are able to install this gem
successfully.
If you are a non-i386 Linux user, please try `gem install console` and
report the result (success/failure) along with your OS version and your
ruby version.
For extra credit, here's a test script you can run and make sure the
output is a 30-column block of text:
## encoding: UTF-8 (this comment required for ruby 1.9)
require 'rubygems' # this line required for ruby 1.8
require 'console'
require 'console/string'
Console.init_locale!
STRING = "我能吞下玻璃而不傷身體。Góa ē-tàng chia̍h po-lê, mā bē tio̍h-siong.私はガラスを食べられます。それは私を傷つけません。I can eat glass and it doesn't hurt me."
COLS = 30
rows = STRING.display_width / COLS
(0 .. rows).each { |i| puts STRING.display_slice(i * COLS, COLS) }
Thanks!
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next reply other threads:[~2011-01-18 20:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-18 20:05 William Morgan [this message]
2011-01-18 21:20 ` Sascha Silbe
2011-01-18 22:30 ` Hamish D
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=1295381104-sup-809@masanjin.net \
--to=wmorgan-sup@masanjin.net \
--cc=sup-devel@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