Textify
Some basic, non-curses-based functions to aid user interaction in text-only ruby scripts. Included are functions for
* Justifying strings
* List selection, confirmation, data entry
* Displaying arrays and hashes as tables
Usage
require "textify"
class MyClass
textify
def foo
[[1,2,3],[4,5,6],[7,8,9]].table({:headings => %w[ one two three ]})
end
end
o = MyClass.new
o.foo
The snippet above outputs:
****************************************
* one * two * three *
****************************************
* 1 * 2 * 3 *
* 4 * 5 * 6 *
* 7 * 8 * 9 *
****************************************