Title photo
frugal technology, simple living and guerrilla large-appliance repair
Mon, 23 Oct 2017

The Ruby Terminal Apps Toolkit could solve many problems

I'm not quite sure how I stumbled upon the Ruby Terminal Apps Toolkit, but the gems included can definitely speed your development of interactive Ruby apps on the command line.

I just coded a menu for my app, and these gems by Piotr Murach offer a lot of ways to do this easily and to solicit and process user input.

The next thing I'm looking at doing in my app is allowing users to open lines for editing in their text editor of choice, and these TTY gems definitely do that. I wasn't thinking that shelling out to an editor would be so hard (meaning that was something that Ruby can do with no gems), but maybe this is a better (or easier) way.

The "hard" part in allowing user editing in my app is that I am assembling files to upload from a series of variables, and I think I'll have to create temporary files for editing that only include the component being modified (i.e. title, text, link, filename) because my app knows how to turn variables into a file but not a file into a series of variables, though that is something I could code into it. (But I may not do this because I am thinking of going in another direction and not creating actual files on the system at all and using Ruby to stream the data via FTP.)

That's more detail without context about the app I'm working on than you need.

tl;dr: The Ruby Terminal Apps Toolkit can speed up development of command-line based apps. You can use single gems or the whole thing. It's up to you.