wbailey / command_line_reporter

A gem for making it easy to produce a report while a ruby script is executing
Apache License 2.0
432 stars 23 forks source link

Table with encoding option for ascii or unicode output #7

Closed tobijb closed 10 years ago

tobijb commented 10 years ago

Allow the table and rows to output the ascii characters. Updated tests, docs, and an example to reflect change.

Here's an example of the output generated by the change.

ruby -I lib examples/ascii_table.rb | tail -n10

A table with no width will determine width automatically

+------------------------------------------+-------------------------+---------------+
| MY NAME IS REALLY LONG AND WILL NOT WRAP |      ADDRESS            | CITY          |
+------------------------------------------+-------------------------+---------------+
|                  caeser                  |      1 Appian Way       | Rome          |
+------------------------------------------+-------------------------+---------------+
|              Richard Feynman             |      1 Golden Gate      | Quantum Field |
+------------------------------------------+-------------------------+---------------+

Build looks good as well on my box

ruby-1.9.3-p484@command_line_reporter  ~/Documents/workspace/command_line_reporter (table_with_encoding_option) $ rspec
..............................................................................................................................................................................................................

Finished in 0.19245 seconds
204 examples, 0 failures
ruby-1.9.3-p484@command_line_reporter  ~/Documents/workspace/command_line_reporter (table_with_encoding_option) $