Created
November 20, 2016 18:44
-
-
Save heymatthew/c6f61f96430baae58aab1b5a45f97c3e to your computer and use it in GitHub Desktop.
Quickly find if you're running the latest rbenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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