Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ruby function to tabulate data in command line

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 test
Octocat-spinner-32 .bnsignore
Octocat-spinner-32 .gitignore
Octocat-spinner-32 History.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 version.txt
README.md

tabulate

Create fancy command line tables with ease.

Builtin styles:

"simple", "plain", "fancy", "sqlite", "plain2", "plain_alt", "legacy".

PLEASE BE AWARE this is my first gem :) .

Features

  • Builtin styles
  • Colored data input support
  • Double width east Asian character support with ruby 1.9

Examples

source = [["\e[31maht\e[m",3],[4,"\e[33msomething\e[m"],['s',['abc','de']]]
labels = ["a",'b']
puts tabulate(labels, source, :indent => 4, :style => 'legacy')

will produce a table like the following, with "aht" colored in red and "something" in yellow.

+-----+-----------+
| a   | b         |
+=====+===========+
| aht | 3         |
| 4   | something |
| s   | abc       |
|     | de        |
+-----+-----------+

Requirements

Nil. East Asian character support requires ruby 1.9 and above.

Install

gem install tabulate

License

MIT

Something went wrong with that request. Please try again.