terabyte/terminal-table — pull request #1 by yzhou7 (2013-08-11 01:55:47+00:00)
Title: Add word wrap to Terminal Table

Introduces 2 new attributes to the Style class:
- wrap (true/false)
- wrap_minimum_width (int)

When wrap is set to true, and when a width argument is given, the
table will word wrap columns so that the printed table will meet
the given width.

Before rendering, the Terminal::Table.adjust_widths method will
check to see if wrap is on, width is defined, and whether the
rows even exceed the defined width. If all these are true, then it
will:
- Sort the columns by width
- Pack in the smallest columns first, making sure to leave enough
room (wrap_minimum_width) for the rest of the columns
- When it runs out of room, word-wrap the rest of the columns to
the remaining space

If there is not enough room for all columns to have
wrap_minimum_width space, it will throw an exception.