Meltemi Meltemi - 1 year ago 81
Ruby Question

Find latest available RVM version number

I can't seem to find an easy way to identify the latest release of RVM from command line or!?!

I currently type

rvm get latest
every few days or so to update RVM. If version is same, RVM goes through the download & update process regardless. I'd like to be able to first 'see' if there's an update to get.

Anyone know how? I'm sure I'm missing the obvious...

Answer Source

you could use this one liner to check version:

$ curl -sS | awk -F": |\"" '$2=="ref"{sub(/.*\//,"",$5); print $5}' | sort -V | tail -n 1

or a pure ruby one liner:

$ ruby -ropen-uri -rjson -e 'open(""){|r| puts JSON.parse({|l| l["ref"].gsub(/.*\//,"").split(".").map(&:to_i)}.sort.last.join(".") }'

but the simplest thing to do is:

$ curl
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download