{"id":1050,"date":"2020-05-24T16:23:27","date_gmt":"2020-05-25T00:23:27","guid":{"rendered":"https:\/\/accretiondisc.com\/blog\/?p=1050"},"modified":"2020-05-24T16:23:27","modified_gmt":"2020-05-25T00:23:27","slug":"useful-gems-2020-edition","status":"publish","type":"post","link":"https:\/\/accretiondisc.com\/blog\/2020\/05\/24\/useful-gems-2020-edition\/","title":{"rendered":"Useful gems, 2020 edition"},"content":{"rendered":"\n<p>Since the gem ecosystem keeps changing, and since I don&#8217;t write new programs very often, here&#8217;s a list of my favorite gems for developing command-line interface tools.<\/p>\n\n\n\n<p>Option parsing gem: <a href=\"https:\/\/github.com\/leejarvis\/slop\">slop<\/a>. (Since<a href=\"https:\/\/github.com\/florianpilz\/micro-optparse\"> micro-optparse<\/a> looks moribund; see <a href=\"https:\/\/www.ruby-toolbox.com\/categories\/CLI_Option_Parsers\">here<\/a>.) But (looking at programs I&#8217;ve written) I also seem to like <del>trollop<\/del>, a\/k\/a <a href=\"https:\/\/github.com\/ManageIQ\/optimist\">optimist<\/a>.  But I also like the fine-grained control of <a href=\"https:\/\/ruby-doc.org\/stdlib-2.7.0\/libdoc\/optparse\/rdoc\/OptionParser.html\">OptionParser<\/a>.<\/p>\n\n\n\n<p>Debugging output (not the same as logging): <a href=\"https:\/\/github.com\/piotrmurach\/pastel\">pastel<\/a><\/p>\n\n\n\n<p>Invoking system functions gem: <a href=\"https:\/\/github.com\/piotrmurach\/tty-command\">tty-command<\/a>. (See also <a href=\"https:\/\/github.com\/piotrmurach\/tty-config\">tty-config<\/a> and <a href=\"https:\/\/github.com\/piotrmurach\/tty-file\">tty-file<\/a>.) But sadly, tty-command (or how I&#8217;ve used it) gets me warnings that bellyache about <a href=\"https:\/\/www.reddit.com\/r\/ruby\/comments\/gjjayp\/matz_is_calling_for_feedback_on_ruby_2730_keyword\/\">the 2.7 named argument splat problem<\/a>.<\/p>\n\n\n\n<p>Wrapper for ImageMagick: About a decade ago, I couldn&#8217;t get <a href=\"https:\/\/rmagick.github.io\/\">RMagick<\/a> (rubymagick?) to compile and I&#8217;ve never gotten around to checking back. For awhile I used <code>%x&lt;convert ...><\/code> or whatever, but now, if I&#8217;m working with images, I&#8217;ve sometimes found <a href=\"https:\/\/github.com\/minimagick\/minimagick\">mini-magick<\/a> helpful.<\/p>\n\n\n\n<p>Proper Capitalization of Text Strings That Are Titles: <a href=\"https:\/\/github.com\/granth\/titleize\">titleize<\/a>.<\/p>\n\n\n\n<p>Parsing Biblical references (e.g., Romans 8:39 and Genesis 12:1-4): <a href=\"https:\/\/github.com\/boblail\/pericope\">pericope<\/a>.<\/p>\n\n\n\n<p>Plus <a href=\"https:\/\/github.com\/gettalong\/kramdown\">Kramdown<\/a> and <a href=\"https:\/\/github.com\/haml\/haml\">HAML<\/a> and <a href=\"http:\/\/sass-lang.com\/\">SASS<\/a> (which is no longer written in Ruby).<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the gem ecosystem keeps changing, and since I don&#8217;t write new programs very often, here&#8217;s a list of my favorite gems for developing command-line interface tools. Option parsing gem: slop. (Since micro-optparse looks moribund; see here.) But (looking at programs I&#8217;ve written) I also seem to like trollop, a\/k\/a optimist. But I also like [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[52],"tags":[468,1001,415,1077,1073,1074,1076,200,1075,709],"class_list":["post-1050","post","type-post","status-publish","format-standard","hentry","category-technology","tag-command-line-interface","tag-gems","tag-imagemagick","tag-kramdown","tag-optimist","tag-optionparser","tag-pericope","tag-ruby-2","tag-titleize","tag-tty"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paRqpr-gW","_links":{"self":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts\/1050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/comments?post=1050"}],"version-history":[{"count":0,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/posts\/1050\/revisions"}],"wp:attachment":[{"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/media?parent=1050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/categories?post=1050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/accretiondisc.com\/blog\/wp-json\/wp\/v2\/tags?post=1050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}