Hirb-unicode
hirb-unicode
fixes the problem that full-width unicode characters is aligned incorrectly.
In the original hirb
unicode gem, the full-width character will be misaligned:
With hirb-unicode-steakknife
, the cells is correctly aligned:
Installation
gem install hirb-unicode-steakknife
Usage
This will load hirb
and hirb-unicode-steakknife
, and fix the unicode problem automtically:
gem 'hirb-unicode-steakknife'
require 'hirb-unicode'
If you are using bundler
(ex. Rails 3), add hirb-unicode-steakknife
into your gemfile:
gem 'hirb-unicode-steakknife'
And run require 'hirb-unicode'
in your irb console or .irbrc
Dependency
hirb-unicode-steakknife
uses unicode-display_width
gem to calculate width of unicode characters.
Testing
rake test:hirb
loadshirb
andhirb-unicode-steakknife
, run all test of originalhirb
gem. This ensures the originalhirb
functionality is not broken.rake test:unicode
tests functions about unicode string processing.rake test
run both two tests above.
License
Read MIT-LICENSE file for details.