4 ms·
ANSI gem does a lot of this already http://rubyworks.github.com/ansi http://rubyworks.github.com/ansi. I'm always a bit leery of all-in-one libraries. If librar
by transfire 12y ago
ANSI gem does a lot of this already http://rubyworks.github.com/ansi http://rubyworks.github.com/ansi.
I'm always a bit leery of all-in-one libraries. If libraries have good SOC then it's nice to be able to mix and match.
- pmurach 12y agoI agree, all-in-one proposition is not my style either. From what I can tell the ANSI gem deals only with ansi strings transformations. This library has ansi string coloring but only to support output colorization for the shell. The tty gem has a rather specific scope, which is to help read data in from command line and display it in some pleasant form such as data table to the user. This library does not deal with parsing command line arguments. There area already awesome propositions out there such as https://github.com/erikhuda/thor https://github.com/erikhuda/thor or https://github.com/leejarvis/slop https://github.com/leejarvis/slop to name a few. Basically tty gem tries to fit in the middle ground between gems that are options parsers and complete solutions for structuring command line apps. It is a sort of glue for common tasks based on my experience writing command line apps.
- pmurach 12y agoIn future I will break dependencies out into smaller components such as tty-prompt tty-table tty-terminal etc... which should help in mixing and matching what you need and the tty gem itself may be just a meta gem that pulls them all in.