Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Ruby library that can put an array of arrays into a ascii table? [closed]

Tags:

ruby

I'm looking for a Ruby library that will task an array of arrays (like the CSV does) and outputs a string that displays the data in an ASCII table like this:

+----------+-------------+
| route_id | route_color |
+----------+-------------+
| 01-1079  | FFFF7C      |
| 04-1079  | FFFF7C      |
+----------+-------------+

Is such a thing available?

like image 725
dan Avatar asked Jan 27 '11 04:01

dan


1 Answers

https://github.com/visionmedia/terminal-table (Gem at http://rubygems.org/gems/terminal-table)

This library appears to do exactly what you want.

like image 85
Dylan Markow Avatar answered Sep 23 '22 02:09

Dylan Markow