How can I determine what the current stable version of Ruby is? -


i want write ruby method 2 things:

  1. determine current stable version of ruby is. first thought response https://www.ruby-lang.org/en/downloads/ , use regex isolate phrase the current stable version [x]. there api i'm not aware of?

  2. get url download .tar.gz of release. thinking same thing, output of site url.

i'm looking advice best way go it, or direction if there's in place might use determine desired results.

ruby code fetch download page, parse current version , link url:

html = net::http.get(uri("https://www.ruby-lang.org/en/downloads/")) vers = html[/http.*ruby-(.*).tar.gz/,1] link = html[/http.*ruby-.*.tar.gz/] 

github code: ruby-stable-version.rb
shell code: ruby-stable-version


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -