kuboon
1/25/2015 - 8:16 PM

Ruby/Rails supported versions matrix

Ruby/Rails supported versions matrix

rails1.8.71.9.21.9.32.0.02.12.1.12.2jrubyjruby-19moderbxrbx-19moderbx-2ruby-head
v4.2.0oooooo
v4.1.9ooooooo
v4.1.8oooooo
v4.1.7.1oooooo
v4.1.7oooooo
v4.1.6oooooo
v4.1.5oooooo
v4.1.4oooooo
v4.1.3oooooo
v4.1.2oooooo
v4.1.1ooooo
v4.1.0ooooo
v4.0.13ooooooo
v4.0.12oooooo
v4.0.11.1oooooo
v4.0.11oooooo
v4.0.10oooooo
v4.0.9oooooo
v4.0.8oooooo
v4.0.7oooooo
v4.0.6oooooo
v4.0.5ooooo
v4.0.4ooooo
v4.0.3oooo
v4.0.2oooo
v4.0.1oooo
v4.0.0oo
v3.2.21oooo
v3.2.20oooo
v3.2.19oooo
v3.2.18oooo
v3.2.17oooo
v3.2.16oooo
v3.2.15oooo
v3.2.14oooo
v3.2.13oooo
v3.2.12ooo
v3.2.11ooo
v3.2.10ooo
v3.2.9ooo
v3.2.8ooo
v3.2.7ooo
v3.2.6ooo
v3.2.5ooo
v3.2.4ooo
v3.2.3ooo
v3.2.2ooo
v3.2.1ooo
v3.2.0ooo
v3.1.12ooo
v3.1.11ooo
v3.1.10ooo
v3.1.9ooo
v3.1.8ooo
v3.1.7ooo
v3.1.6ooo
v3.1.5ooo
v3.1.4ooo
v3.1.3ooo
v3.1.2ooo
v3.1.1ooo
v3.1.0ooo
v3.0.20ooo
v3.0.19ooo
v3.0.18ooo
v3.0.17ooo
v3.0.16ooo
v3.0.15ooo
v3.0.14ooo
v3.0.13ooo
v3.0.12ooo
v3.0.11ooo
v3.0.10oo
# gem install octokit
require 'octokit'
require 'yaml'

TARGET = 'rails/rails'

def main
  md_table 'rails', tags.lazy.map(&method(:pair)).take_while{|k,v| v}.to_h
end
def md_table(name, hash)
  columns = hash.values.flatten.uniq.sort

  lines = ["#{name}|#{columns.join('|')}"]
  lines << (["---"] * (columns.length + 1)).join('|')
  lines + hash.map{|k,v| "#{k}|" + columns.map{|c| v.include?(c) ? 'o' : ''}.join('|')}
end
def tags
  Octokit.auto_paginate = true
  Octokit.tags(TARGET).reject{|tag| tag['name'].include?('rc') || tag['name'].include?('beta') }
end
def pair(tag)
  [tag['name'], rvm_list_on(tag['commit']['sha'])]
end
def rvm_list_on(sha)
  travis = yaml("https://raw.githubusercontent.com/#{TARGET}/#{sha}/.travis.yml")
  return nil if travis.nil? || travis['rvm'].nil?
  travis['rvm'].map(&:to_s)
end
def yaml(url)
  YAML.load(Net::HTTP.get(URI.parse(url)))
end

puts main