Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Created December 31, 2015 19:05
Show Gist options
  • Select an option

  • Save blizzarddreams/2ffbcda88d30cf568d1a to your computer and use it in GitHub Desktop.

Select an option

Save blizzarddreams/2ffbcda88d30cf568d1a to your computer and use it in GitHub Desktop.
URL = "http://dl.bintray.com/oneclick/rubyinstaller/"
RUBY_VERSIONS_AVAILABLE = open(URL).read.scan(/>(.+)<\/a>/) # TODO: make this better.
.flatten
.delete_if { |r| r =~ /(md5|64|sha256|exe|doc|defunct\/)/ }
.map { |r| r[/>(.+)/].gsub(/>|ruby-/, "").gsub(/(-i386-(.+).7z)/, "") }
.uniq
.group_by { |x| x.split('-')[0] }
.tap { |x| x.map { |key, value| x[key] = x[key].map { |y| y.split('-')[1] }.join('|') } }
.map { |x, y| !y.empty? ? "#{x}[#{y}]" : x }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment