Skip to content

Instantly share code, notes, and snippets.

@cbetta
Last active August 29, 2015 14:26
Show Gist options
  • Save cbetta/5a8d7e0eacd0014bce1d to your computer and use it in GitHub Desktop.
Save cbetta/5a8d7e0eacd0014bce1d to your computer and use it in GitHub Desktop.
Get the latest version of a gem
alias latest='function _latest(){ curl -s "https://rubygems.org/api/v1/versions/$1/latest.json" | cut -d"\"" -f 4 };_latest'
$ latest rails
4.2.3
@zygote
Copy link

zygote commented Aug 5, 2015

Thanks, this is super handy.

I modified your script for Hex (Elixir)

alias exlatest='function _latest(){ curl -s "https://hex.pm/api/packages/$1" | cut -d"\"" -f 14 };_latest'

@bpinto
Copy link

bpinto commented Aug 5, 2015

What about using gem builtin command? e.g. gem list -r '^rails$'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment