Last Updated: February 25, 2016
·
310
· michaelparenteau

Use Alfred.app & some bash to get current Ruby Gem version number

Say you are in a Gemfile in one of your ruby apps and you need to update a dependency.. or maybe even more regularly are in a Gemfile and are ready to drop in a gem and you want to lock it to a version so your software stays stable with other gems/versions throughout development. Well, you could go to https://rubygems.org/ and search for the gem, copy the version number, switch back to your editor and then paste it in.

I created an Alfred workflow that basically allows you to enter a gem name and it does the search, finds the latest version number and copies it to your clipboard for you.

alfred screenshot

So you can just be in your editor and do a [Ctrl + spacebar] on your keyboard, type gemv: [gemname] and you will get a big display with the number and it will be in your clipboard to paste in the editor you are already in. I have found it super convenient.

Here is a link to the workflow on github. Hope you find it useful :)


NOTE: You will need Alfred2 with the Power Pack to use this. The Power pack costs money, but honestly I have paid for it in time I have saved myself in the amount of times i have use just this workflow alone... there are lots of other workflows I use on a regular basis that are rad.