Skip to content

Instantly share code, notes, and snippets.

@segiddins

segiddins/each_ruby

Last active Aug 29, 2015
Embed
What would you like to do?
Run a shell command in each rbenv version installed
#!/usr/bin/ruby
versions = `rbenv versions --bare`.split("\n").map(&:strip)
warn "rbenv not installed" && exit(1) unless $?.success?
versions.each do |v|
puts "rbenv shell #{v}"
puts
system({"RBENV_VERSION" => v}, ARGV.join(' '))
puts '-' * 80
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment