[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sup-devel] console gem 0.3
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