Skip to content

Instantly share code, notes, and snippets.

@heymatthew
Created November 20, 2016 18:44
Show Gist options
  • Save heymatthew/c6f61f96430baae58aab1b5a45f97c3e to your computer and use it in GitHub Desktop.
Save heymatthew/c6f61f96430baae58aab1b5a45f97c3e to your computer and use it in GitHub Desktop.
Quickly find if you're running the latest rbenv
#!/usr/bin/env ruby
def get_lines(output)
output.lines.map(&:chomp).map(&:strip)
end
available = get_lines(`rbenv install -l`).select { |v| v.match(/^[\d\.]+$/) }
installed = get_lines(`rbenv versions`)
puts
puts "Installed"
puts "="*40
puts installed
puts
puts "Last 3 Stable"
puts "="*40
puts available.last(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment