I just published the Rangu Gem on RubyGems this week early.

Recently, I spend lots of time on GitHub to search fascinating repository to fork. And I found that I already start a cool repo name “pangu.py”. Made by Vinta, a badass developer I like. It’s a tool to make your string or text file beautiful and cleaner. So I fork it and build a copy gem and name it like other Ruby things Rangu.

So, What’s Pangu and Rangu?

Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits, and symbols).

Instruction from pangu.py’s README file

In Taiwan, my country. We use Traditional Chinese (as know as zh_TW in Unicode) so If we want to use both English and Chinese in a sentence. The space between the two languages will be a little uncomfortable.

Like,

「與PM戰鬥的人,應當小心自己不要成為PM。」

(Whoever struggles with PM may see to it that he does not thereby become a PM. )

or

「當你凝視著bug,bug也凝視著你。」

(When you look long into a bug, the bug looks into you.)

A little bit Crowded, right? So I always type whitespace between them.

Like

「與 PM 戰鬥的人,應當小心自己不要成為 PM。」

「當你凝視著 bug,bug 也凝視著你。」

It’s more readability and makes me feel good.

Then, I took an afternoon to rewrite it as a gem in Ruby. If you are facing some trouble in Chinese, Japanese or Korean. You can fix it in everywhere with Rangu after command gem install rangu.

Happy Coding!