Last active
May 1, 2021 10:20
-
-
Save thoolihan/11234055 to your computer and use it in GitHub Desktop.
script to make sure you have rcodetools installed for all rvm rubies
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 | |
rubies = `rvm list`.split(/\s+/).find_all{|s| s.include? "ruby"} | |
def fetch_for(rvm_spec) | |
system "rvm use #{rvm_spec}" | |
system "gem install rcodetools" | |
end | |
def valid_gemset?(name) | |
!(name.include?("(default)") or | |
name.include?("global") or | |
name.empty?) | |
end | |
rubies.each do |rb| | |
fetch_for rb | |
gemsets = `rvm gemset list`.split(/\s+/).find_all{|s| valid_gemset?(s)} | |
gemsets.each do |gemset| | |
fetch_for "#{rb}@#{gemset}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
has some bugs to work out...