Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

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.