visionmedia/terminal-table — pull request #14 by rrrene (2011-10-18 09:09:12+00:00)
Title: Add Style class for width, borders and padding of cells

This request introduces a Style class to handle the representation of the table on screen.

You now no longer have to patch constants on runtime to change the appearance of borders, and you can define the cell padding for both left and right side:

```ruby
@table.headings = ['Char', 'Num']
@table.style = {:border_x => "=", :border_y => ":", :border_i => "x", :padding_left => 0, :padding_right => 2}
@table << ['a', 1]
@table << ['b', 2]
@table << ['c', 3]
```

which outputs:

```
x======x=====x
:Char :Num :
x======x=====x
:a :1 :
:b :2 :
:c :3 :
x======x=====x
```

As you can see from the commits, this also helps us get rid of all the magic numbers like `+ 2` and `* 3` in Table and Row.

To provide the effect of

```ruby
Terminal::Table::X = ""
Terminal::Table::Y = ""
Terminal::Table::I = ""
```

one can set defaults in the Style class:

```ruby
Terminal::Table::Style.defaults = {:border_x => "=", :border_y => ":", :border_i => ""}
```

Then all tables created afterwards get these style values by default.

There are a few minor changes as well, like the ability to print an empty Table without errors.