How can I determine what the current stable version of Ruby is? -
i want write ruby method 2 things:
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?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
Post a Comment