Unicode support for hirb
Ruby
Switch branches/tags
Permalink
Failed to load latest commit information.
lib bump version Aug 8, 2011
test init import Feb 16, 2011
.gitignore init import Feb 16, 2011
.travis.yml rm rbx-2.0 from .travis.yml Mar 26, 2012
Gemfile init import Feb 16, 2011
MIT-LICENSE MIT-License Feb 17, 2011
README.md Edited README.md via GitHub Mar 2, 2011
Rakefile init import Feb 16, 2011
hirb-unicode.gemspec travis needs rake Aug 8, 2011

README.md

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:

Original hirb screenshot

With hirb-unicode, the cells is correctly aligned:

Original hirb screenshot

Installation

gem install hirb-unicode

Usage

This will load hirb and hirb-unicode, and fix the unicode problem automtically:

gem 'hirb-unicode'
require 'hirb-unicode'

If you are using bundler (ex. Rails 3), add hirb-unicode into your gemfile:

gem 'hirb-unicode'

And run require 'hirb-unicode' in your irb console or .irbrc

Dependency

hirb-unicode uses unicode-display_width gem to calculate width of unicode characters.

Testing

  • rake test:hirb loads hirb and hirb-unicode, run all test of original hirb gem. This ensures the original hirb 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.